1{-# OPTIONS_GHC -Wall #-}
2module Transform.Definition where
4import Control.Applicative ((<$>))
5import qualified AST.Pattern as P
6import qualified AST.Expression.Source as Source
7import qualified AST.Expression.Valid as Valid
8import qualified Transform.Expression as Expr
10combineAnnotations :: [Source.Def] -> Either String [Valid.Def]
15 "Syntax Error: The type annotation for '" ++ x ++
16 "' must be directly above its definition."
18 exprCombineAnnotations =
19 Expr.crawlLet combineAnnotations
23 Source.TypeAnnotation name tipe : rest ->
25 Source.Definition pat@(P.Var name') expr : rest'
27 do expr' <- exprCombineAnnotations expr
28 let def = Valid.Definition pat expr' (Just tipe)
32 Left (errorMessage name)
34 Source.Definition pat expr : rest ->
35 do expr' <- exprCombineAnnotations expr
36 let def = Valid.Definition pat expr' Nothing
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