Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/compiler98/Derive/Lib.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module Derive.Lib where

import Syntax
import IntState
import NT
import State

syntaxCtxs :: Pos -> [(id, id)] -> [Context id]
syntaxCtxs pos ctxs = map ( \ (c,v) -> Context pos c [(pos,v)]) ctxs

syntaxType :: Pos -> id -> [id] -> Type id
syntaxType pos typ tvs = TypeCons pos typ (map (TypeVar pos) tvs)

noArgs :: Info -> Bool
noArgs constrInfo =
  case ntI constrInfo of
    (NewType _ _ _ [nt]) -> True
    _ -> False

deriveError :: String -> State t IntState (Decl id) IntState
deriveError str = \ down state ->
  (DeclIgnore str,addError state str)

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].