1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
10import qualified Data.Map.Strict as Map
11import Data.Map.Strict ((!))
13import qualified AST.Canonical as Can
14import qualified Elm.Name as N
30fromSrcType :: Map.Map N.Name Type -> Can.Type -> IO Type
31fromSrcType freeVars sourceType =
33 Can.TLambda arg result ->
35 <$> fromSrcType freeVars arg
36 <*> fromSrcType freeVars result
39 return (freeVars ! name)
41 Can.TType home name args ->
42 AppN home name <$> traverse (fromSrcType freeVars) args
44 Can.TAlias home name args aliasedType ->
45 do targs <- traverse (traverse (fromSrcType freeVars)) args
46 AliasN home name targs <$>
48 Can.Filled realType ->
49 fromSrcType freeVars realType
52 fromSrcType (Map.fromList targs) realType
54 Can.TTuple a b maybeC ->
56 <$> fromSrcType freeVars a
57 <*> fromSrcType freeVars b
58 <*> traverse (fromSrcType freeVars) maybeC
63 Can.TRecord fields maybeExt ->
65 <$> traverse (fromSrcType freeVars) fields
72 fromSrcType freeVars ext
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