git.iko.soy/rowtype-yoga/purescript-native
on e82e607 help sign in
68 lines 1.3 kB history raw
1-----------------------------------------------------------------------------
2--
3-- Module : Commands
4-- Copyright : (c) Phil Freeman 2014
5-- License : MIT
6--
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
9-- Portability :
10--
11-- |
12-- Commands for PSCI.
13--
14-----------------------------------------------------------------------------
16module Commands where
18import Language.PureScript
20-- |
21-- Valid Meta-commands for PSCI
22--
23data Command
24 -- |
25 -- A purescript expression
26 --
27 = Expression Value
28 -- |
29 -- Show the help command
30 --
31 | Help
32 -- |
33 -- Import a module from a loaded file
34 --
35 | Import ModuleName
36 -- |
37 -- Load a file for use with importing
38 --
39 | LoadFile FilePath
40 -- |
41 -- Exit PSCI
42 --
43 | Quit
44 -- |
45 -- Reset the state of the REPL
46 --
47 | Reset
48 -- |
49 -- Binds a value to a name
50 --
51 | Let (Value -> Value)
52 -- |
53 -- Find the type of an expression
54 --
55 | TypeOf Value
57-- |
58-- The help menu.
59--
60help :: [[String]]
61help =
62 [ [":? ", "Show this help menu"]
63 , [":i <module> ", "Import <module> for use in PSCI"]
64 , [":m <file> ", "Load <file> for importing"]
65 , [":q ", "Quit PSCi"]
66 , [":r ", "Reset"]
67 , [":t <expr> ", "Show the type of <expr>"]
68 ]