1-----------------------------------------------------------------------------
3-- Module : Language.PureScript.TypeDeclarations
4-- Copyright : (c) Phil Freeman 2013
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
13-----------------------------------------------------------------------------
15module Language.PureScript.TypeDeclarations (
16 desugarTypeDeclarations,
17 desugarTypeDeclarationsModule
20import Control.Applicative
21import Control.Monad.Error.Class
22import Control.Monad (forM)
24import Language.PureScript.Declarations
25import Language.PureScript.Values
27desugarTypeDeclarationsModule :: [Module] -> Either String [Module]
28desugarTypeDeclarationsModule ms = forM ms $ \(Module name ds) -> Module name <$> desugarTypeDeclarations ds
30desugarTypeDeclarations :: [Declaration] -> Either String [Declaration]
31desugarTypeDeclarations (TypeDeclaration name ty : ValueDeclaration name' [] Nothing val : rest) | name == name' =
32 desugarTypeDeclarations (ValueDeclaration name [] Nothing (TypedValue val ty) : rest)
33desugarTypeDeclarations (TypeDeclaration name _ : _) = throwError $ "Orphan type declaration for " ++ show name
34desugarTypeDeclarations (d:ds) = (:) d <$> desugarTypeDeclarations ds
35desugarTypeDeclarations [] = return []
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list