1-----------------------------------------------------------------------------
3-- Module : Language.PureScript.Prim
4-- Copyright : (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
13-----------------------------------------------------------------------------
15module Language.PureScript.Prim where
17import Language.PureScript.Kinds
18import Language.PureScript.Names
19import Language.PureScript.Types
21import qualified Data.Map as M
24-- Type constructor for functions
27tyFunction = TypeConstructor $ (Qualified $ Just $ ModuleName [ProperName "Prim"]) (ProperName "Function")
30-- Type constructor for strings
33tyString = TypeConstructor $ (Qualified $ Just $ ModuleName [ProperName "Prim"]) (ProperName "String")
36-- Type constructor for numbers
39tyNumber = TypeConstructor $ (Qualified $ Just $ ModuleName [ProperName "Prim"]) (ProperName "Number")
42-- Type constructor for booleans
45tyBoolean = TypeConstructor $ (Qualified $ Just $ ModuleName [ProperName "Prim"]) (ProperName "Boolean")
48-- Type constructor for arrays
51tyArray = TypeConstructor $ (Qualified $ Just $ ModuleName [ProperName "Prim"]) (ProperName "Array")
54-- Smart constructor for function types
56function :: Type -> Type -> Type
57function t1 = TypeApp (TypeApp tyFunction t1)
60-- The primitive types in the external javascript environment with their associated kinds.
62primTypes :: M.Map (Qualified ProperName) Kind
63primTypes = M.fromList [ (primName "Function" , FunKind Star (FunKind Star Star))
64 , (primName "Array" , FunKind Star Star)
65 , (primName "String" , Star)
66 , (primName "Number" , Star)
67 , (primName "Boolean" , Star) ]
69 primName name = Qualified (Just $ ModuleName [ProperName "Prim"]) (ProperName name)
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