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]
11combineAnnotations = go
13 msg x = "Syntax Error: The type annotation for '" ++ x ++
14 "' must be directly above its definition."
16 exprCombineAnnotations = Expr.crawlLet combineAnnotations
20 Source.TypeAnnotation name tipe : rest ->
22 Source.Definition pat@(P.Var name') expr : rest'
24 do expr' <- exprCombineAnnotations expr
25 let def = Valid.Definition pat expr' (Just tipe)
30 Source.Definition pat expr : rest ->
31 do expr' <- exprCombineAnnotations expr
32 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