stefan@stefans-MacBook-Pro curs6 % ghci ghci GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help Prelude> :l curs6 :l curs6 [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> f 10 f 10 13 *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) curs6.hs:35:1: error: The type signature for ‘ex1’ lacks an accompanying binding | 35 | ex1 :: Ord a => [a] -> [b] -> [(a, b)] | ^^^ curs6.hs:40:1: error: The type signature for ‘ex2’ lacks an accompanying binding | 40 | ex2 :: a -> b | ^^^ curs6.hs:53:1: error: The type signature for ‘ex3’ lacks an accompanying binding Perhaps you meant one of these: ‘ex3a’ (Defined at curs6.hs:47:1), ‘ex3b’ (Defined at curs6.hs:50:1) | 53 | ex3 :: [a] -> a | ^^^ Failed, no modules loaded. Prelude> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) curs6.hs:35:1: error: The type signature for ‘ex1’ lacks an accompanying binding Perhaps you meant ‘ex3’ (Defined at curs6.hs:54:1) | 35 | ex1 :: Ord a => [a] -> [b] -> [(a, b)] | ^^^ curs6.hs:40:1: error: The type signature for ‘ex2’ lacks an accompanying binding Perhaps you meant ‘ex3’ (Defined at curs6.hs:54:1) | 40 | ex2 :: a -> b | ^^^ Failed, no modules loaded. Prelude> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) curs6.hs:35:1: error: The type signature for ‘ex1’ lacks an accompanying binding Perhaps you meant ‘ex3’ (Defined at curs6.hs:54:1) | 35 | ex1 :: Ord a => [a] -> [b] -> [(a, b)] | ^^^ Failed, no modules loaded. Prelude> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> v v ^C ^C^CInterrupted. *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> 34 + 5 34 + 5 39 *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> fib 10 fib 10 55 *Main> fib 20 fib 20 6765 *Main> fib 30 fib 30 832040 *Main> fib 34 fib 34 5702887 *Main> fib 40 fib 40 ^C ^C^CInterrupted. *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> a a 2 *Main> let x = 2 in x + x let x = 2 in x + x 4 *Main> let x = 2 in x * 10 let x = 2 in x * 10 20 *Main> let x = 2 + 2 in x * x * 10 let x = 2 + 2 in x * x * 10 160 *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> b b 2 *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) curs6.hs:123:1: error: Multiple declarations of ‘f’ Declared at: curs6.hs:1:1 curs6.hs:123:1 | 123 | f x y = if x > 2 then y else 10 | ^ Failed, no modules loaded. Prelude> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> g 10 (fib 100) g 10 (fib 100) ^C ^C^CInterrupted. *Main> g 1 (fib 100) g 1 (fib 100) 10 *Main> ite (1 > 2) 4 5 ite (1 > 2) 4 5 :27:1: error: • Variable not in scope: ite :: Bool -> t0 -> t1 -> t • Perhaps you meant ‘it’ (line 26) *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> ite (1 > 2) 4 5 ite (1 > 2) 4 5 5 *Main> ite (1 > 2) (fib 100) 5 ite (1 > 2) (fib 100) 5 5 *Main> :r :r [1 of 1] Compiling Main ( curs6.hs, interpreted ) Ok, one module loaded. *Main> double 3 double 3 (3,3) *Main> double (fib 30) double (fib 30) (832040,832040) *Main> :h :h Commands available from the prompt: evaluate/run : repeat last command :{\n ..lines.. \n:}\n multiline command :add [*] ... add module(s) to the current target set :browse[!] [[*]] display the names defined by module (!: more details; *: all top-level names) :cd change directory to :cmd run the commands returned by ::IO String :complete [] list completions for partial input string :ctags[!] [] create tags file for Vi (default: "tags") (!: use regex instead of line number) :def[!] define command : (later defined command has precedence, :: is always a builtin command) (!: redefine an existing command name) :doc display docs for the given name (experimental) :edit edit file :edit edit last module :etags [] create tags file for Emacs (default: "TAGS") :help, :? display this list of commands :info[!] [ ...] display information about the given names (!: do not filter instances) :instances display the class instances available for :issafe [] display safe haskell information of module :kind[!] show the kind of (!: also print the normalised type) :load[!] [*] ... load module(s) and their dependents (!: defer type errors) :main [ ...] run the main function with the given arguments :module [+/-] [*] ... set the context for expression evaluation :quit exit GHCi :reload[!] reload the current module set (!: defer type errors) :run function [ ...] run the function with the given arguments :script run the script :type show the type of :type +d show the type of , defaulting type variables :type +v show the type of , with its specified tyvars :unadd ... remove module(s) from the current target set :undef undefine user-defined command : :: run the builtin command :! run the shell command -- Commands for debugging: :abandon at a breakpoint, abandon current computation :back [] go back in the history N steps (after :trace) :break [] [] set a breakpoint at the specified location :break set a breakpoint on the specified function :continue resume after a breakpoint :delete ... delete the specified breakpoints :delete * delete all breakpoints :disable ... disable the specified breakpoints :disable * disable all breakpoints :enable ... enable the specified breakpoints :enable * enable all breakpoints :force print , forcing unevaluated parts :forward [] go forward in the history N step s(after :back) :history [] after :trace, show the execution history :list show the source code around current breakpoint :list show the source code for :list [] show the source code around line number :print [ ...] show a value without forcing its computation :sprint [ ...] simplified version of :print :step single-step after stopping at a breakpoint :step single-step into :steplocal single-step within the current top-level binding :stepmodule single-step restricted to the current module :trace trace after stopping at a breakpoint :trace evaluate with tracing on (see :history) -- Commands for changing settings: :set