GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> :load "EnvInClass.hs" [1 of 1] Compiling EnvInClass ( EnvInClass.hs, interpreted ) EnvInClass.hs:13:18: Couldn't match expected type `a' with actual type `[Char]' `a' is a rigid type variable bound by the type signature for empty :: Env a at EnvInClass.hs:7:10 Relevant bindings include empty :: Env a (bound at EnvInClass.hs:13:1) In the expression: error "no binding for " ++ v In the first argument of `E', namely `(\ v -> error "no binding for " ++ v)' In the expression: E (\ v -> error "no binding for " ++ v) Failed, modules loaded: none. Prelude> :load "EnvInClass.hs" [1 of 1] Compiling EnvInClass ( EnvInClass.hs, interpreted ) Ok, modules loaded: EnvInClass. *EnvInClass> :load "EnvInClass.hs" [1 of 1] Compiling EnvInClass ( EnvInClass.hs, interpreted ) Ok, modules loaded: EnvInClass. *EnvInClass> :load "EnvInClass.hs" [1 of 1] Compiling EnvInClass ( EnvInClass.hs, interpreted ) Ok, modules loaded: EnvInClass. *EnvInClass> :cd c:/cygwin64/home/leavens/classes/cop4020/lectures/haskell-functional/ Warning: changing directory causes all loaded modules to be unloaded, because the search path has changed. Prelude> :load "EnvInClassTests.hs" [1 of 3] Compiling Testing ( Testing.lhs, interpreted ) [2 of 3] Compiling EnvInClass ( EnvInClass.hs, interpreted ) [3 of 3] Compiling EnvInClassTests ( EnvInClassTests.hs, interpreted ) EnvInClassTests.hs:16:14: Ambiguous occurrence `lookup' It could refer to either `Prelude.lookup', imported from `Prelude' at EnvInClassTests.hs:2:8-22 (and originally defined in `GHC.List') or `EnvInClass.lookup', imported from `EnvInClass' at EnvInClassTests.hs:3:1-17 (and originally defined at EnvInClass.hs:12:1-6) EnvInClassTests.hs:18:14: Ambiguous occurrence `lookup' It could refer to either `Prelude.lookup', imported from `Prelude' at EnvInClassTests.hs:2:8-22 (and originally defined in `GHC.List') or `EnvInClass.lookup', imported from `EnvInClass' at EnvInClassTests.hs:3:1-17 (and originally defined at EnvInClass.hs:12:1-6) EnvInClassTests.hs:22:14: Ambiguous occurrence `lookup' It could refer to either `Prelude.lookup', imported from `Prelude' at EnvInClassTests.hs:2:8-22 (and originally defined in `GHC.List') or `EnvInClass.lookup', imported from `EnvInClass' at EnvInClassTests.hs:3:1-17 (and originally defined at EnvInClass.hs:12:1-6) EnvInClassTests.hs:26:14: Ambiguous occurrence `lookup' It could refer to either `Prelude.lookup', imported from `Prelude' at EnvInClassTests.hs:2:8-22 (and originally defined in `GHC.List') or `EnvInClass.lookup', imported from `EnvInClass' at EnvInClassTests.hs:3:1-17 (and originally defined at EnvInClass.hs:12:1-6) EnvInClassTests.hs:27:14: Ambiguous occurrence `lookup' It could refer to either `Prelude.lookup', imported from `Prelude' at EnvInClassTests.hs:2:8-22 (and originally defined in `GHC.List') or `EnvInClass.lookup', imported from `EnvInClass' at EnvInClassTests.hs:3:1-17 (and originally defined at EnvInClass.hs:12:1-6) EnvInClassTests.hs:28:14: Ambiguous occurrence `lookup' It could refer to either `Prelude.lookup', imported from `Prelude' at EnvInClassTests.hs:2:8-22 (and originally defined in `GHC.List') or `EnvInClass.lookup', imported from `EnvInClass' at EnvInClassTests.hs:3:1-17 (and originally defined at EnvInClass.hs:12:1-6) EnvInClassTests.hs:29:14: Ambiguous occurrence `lookup' It could refer to either `Prelude.lookup', imported from `Prelude' at EnvInClassTests.hs:2:8-22 (and originally defined in `GHC.List') or `EnvInClass.lookup', imported from `EnvInClass' at EnvInClassTests.hs:3:1-17 (and originally defined at EnvInClass.hs:12:1-6) Failed, modules loaded: EnvInClass, Testing. *EnvInClass> :load "EnvInClassTests.hs" [1 of 3] Compiling Testing ( Testing.lhs, interpreted ) [2 of 3] Compiling EnvInClass ( EnvInClass.hs, interpreted ) [3 of 3] Compiling EnvInClassTests ( EnvInClassTests.hs, interpreted ) EnvInClassTests.hs:17:31: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the second argument of `add', namely `(IV 3)' In the first argument of `lookup', namely `(add "x" (IV 3) empty)' EnvInClassTests.hs:18:12: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the third argument of `eqTest', namely `(IV 3)' In the expression: eqTest (lookup (add "x" (IV 3) empty) "x") "==" (IV 3) EnvInClassTests.hs:19:31: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the second argument of `add', namely `(IV 4)' In the first argument of `lookup', namely `(add "y" (IV 4) (add "x" (IV 3) empty))' EnvInClassTests.hs:20:40: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the second argument of `add', namely `(IV 3)' In the third argument of `add', namely `(add "x" (IV 3) empty)' EnvInClassTests.hs:22:12: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the third argument of `eqTest', namely `(IV 3)' In the expression: eqTest (lookup (add "y" (IV 4) (add "x" (IV 3) empty)) "x") "==" (IV 3) EnvInClassTests.hs:23:31: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the second argument of `add', namely `(IV 4)' In the first argument of `lookup', namely `(add "y" (IV 4) (add "x" (IV 3) empty))' EnvInClassTests.hs:24:40: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the second argument of `add', namely `(IV 3)' In the third argument of `add', namely `(add "x" (IV 3) empty)' EnvInClassTests.hs:26:12: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the third argument of `eqTest', namely `(IV 4)' In the expression: eqTest (lookup (add "y" (IV 4) (add "x" (IV 3) empty)) "y") "==" (IV 4) EnvInClassTests.hs:27:21: Couldn't match type `Value' with `Env Value' Expected type: Env EV Actual type: Env Value In the first argument of `lookup', namely `envyx43' In the first argument of `eqTest', namely `(lookup envyx43 "y")' EnvInClassTests.hs:27:41: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the third argument of `eqTest', namely `(IV 4)' In the expression: eqTest (lookup envyx43 "y") "==" (IV 4) EnvInClassTests.hs:28:21: Couldn't match type `Value' with `Env Value' Expected type: Env EV Actual type: Env Value In the first argument of `lookup', namely `envyx43' In the first argument of `eqTest', namely `(lookup envyx43 "x")' EnvInClassTests.hs:28:41: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the third argument of `eqTest', namely `(IV 3)' In the expression: eqTest (lookup envyx43 "x") "==" (IV 3) EnvInClassTests.hs:29:21: Couldn't match type `Value' with `Env Value' Expected type: Env EV Actual type: Env Value In the first argument of `lookup', namely `envyx78' In the first argument of `eqTest', namely `(lookup envyx78 "y")' EnvInClassTests.hs:29:41: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the third argument of `eqTest', namely `(IV 7)' In the expression: eqTest (lookup envyx78 "y") "==" (IV 7) EnvInClassTests.hs:30:21: Couldn't match type `Value' with `Env Value' Expected type: Env EV Actual type: Env Value In the first argument of `lookup', namely `envyx78' In the first argument of `eqTest', namely `(lookup envyx78 "x")' EnvInClassTests.hs:30:41: Couldn't match type `Value' with `Env Value' Expected type: EV Actual type: Value In the third argument of `eqTest', namely `(IV 8)' In the expression: eqTest (lookup envyx78 "x") "==" (IV 8) Failed, modules loaded: EnvInClass, Testing. *EnvInClass> :load "EnvInClassTests.hs" [1 of 3] Compiling Testing ( Testing.lhs, interpreted ) [2 of 3] Compiling EnvInClass ( EnvInClass.hs, interpreted ) [3 of 3] Compiling EnvInClassTests ( EnvInClassTests.hs, interpreted ) Ok, modules loaded: EnvInClass, EnvInClassTests, Testing. *EnvInClassTests> main Testing EnvInClassTests $Revision: 1.2 $... IV 3 == IV 3 IV 3 == IV 3 IV 4 == IV 4 IV 4 == IV 4 IV 3 == IV 3 IV 7 == IV 7 IV 8 == IV 8 Finished with 0 failures! *EnvInClassTests> :load "SeqInClass.hs" [1 of 1] Compiling SeqInClass ( SeqInClass.hs, interpreted ) Ok, modules loaded: SeqInClass. *SeqInClass> let halves = generate (\n -> 1.0 / (2.0^(fromInteger n))) *SeqInClass> halves :13:1: No instance for (Show (Seq a0)) arising from a use of `print' In a stmt of an interactive GHCi command: print it *SeqInClass> nth 2 halves 0.25 *SeqInClass> nth 3 halves 0.125 *SeqInClass> nth 4 halves 6.25e-2 *SeqInClass> nth 30 halves 9.313225746154785e-10 *SeqInClass> nth 30000 halves 0.0 *SeqInClass> nth 3000 halves 0.0 *SeqInClass> nth 300 halves 4.909093465297727e-91 *SeqInClass> let h2 = halves `add` halves *SeqInClass> nth 0 h2 2.0 *SeqInClass> nth 1 h2 1.0 *SeqInClass> nth 2 h2 0.5 *SeqInClass> nth 30 h2 1.862645149230957e-9 *SeqInClass>