added extra note
authorcharlie <charlie.gerhardus@student.ru.nl>
Sun, 22 Nov 2015 18:56:35 +0000 (19:56 +0100)
committercharlie <charlie.gerhardus@student.ru.nl>
Sun, 22 Nov 2015 18:56:35 +0000 (19:56 +0100)
a6/mart/skeleton6a.prj
a9/charlie/Main.hs [new file with mode: 0644]
a9/mart/skeleton9.icl

index 592a19b..563830b 100644 (file)
-Version: 1.4
-Global
-       ProjectRoot:    .
-       Target: StdEnv
-       Exec:   {Project}/skeleton6a
-       CodeGen
-               CheckStacks:    False
-               CheckIndexes:   True
-       Application
-               HeapSize:       2097152
-               StackSize:      512000
-               ExtraMemory:    8192
-               IntialHeapSize: 204800
-               HeapSizeMultiplier:     4096
-               ShowExecutionTime:      False
-               ShowGC: False
-               ShowStackSize:  False
-               MarkingCollector:       False
-               DisableRTSFlags:        False
-               StandardRuntimeEnv:     True
-               Profile
-                       Memory: False
-                       MemoryMinimumHeapSize:  0
-                       Time:   False
-                       Stack:  False
-               Output
-                       Output: NoReturnType
-                       Font:   Monaco
-                       FontSize:       9
-                       WriteStdErr:    False
-       Link
-               LinkMethod:     Dynamic
-               GenerateRelocations:    False
-               GenerateLinkMap:        False
-               LinkResources:  False
-               ResourceSource: 
-               GenerateDLL:    False
-               ExportedNames:  
-       Paths
-               Path:   {Project}
-               Path:   {Application}/lib/clean-platform/OS-Independent/
-               Path:   {Application}/lib/Generics
-               Path:   {Application}/lib/Dynamics
-       Precompile:     
-       Postlink:       
-MainModule
-       Name:   skeleton6a
-       Dir:    {Project}
-       Compiler
-               NeverMemoryProfile:     False
-               NeverTimeProfile:       False
-               StrictnessAnalysis:     True
-               ListTypes:      StrictExportTypes
-               ListAttributes: True
-               Warnings:       True
-               Verbose:        True
-               ReadableABC:    False
-               ReuseUniqueNodes:       True
-               Fusion: False
-OtherModules
-       Module
-               Name:   Control.Applicative
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Control.Monad
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Either
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Foldable
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Func
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Functor
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.List
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Map
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Maybe
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Monoid
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Set
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Traversable
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Tuple
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Data.Void
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   System.IO
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Text
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Text.JSON
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   Text.PPrint
-               Dir:    {Application}/lib/clean-platform/OS-Independent/
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   GenEq
-               Dir:    {Application}/lib/Generics
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   _SystemDynamic
-               Dir:    {Application}/lib/Dynamics
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdArray
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdBool
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdChar
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdCharList
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdClass
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdEnum
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdEnv
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdFile
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdFunc
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdGeneric
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdInt
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdList
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdMisc
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdOrdList
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdOverloaded
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdOverloadedList
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdReal
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdStrictLists
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdString
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   StdTuple
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   _SystemArray
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   _SystemEnum
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   _SystemEnumStrict
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
-       Module
-               Name:   _SystemStrictLists
-               Dir:    {Application}/lib/StdEnv
-               Compiler
-                       NeverMemoryProfile:     False
-                       NeverTimeProfile:       False
-                       StrictnessAnalysis:     True
-                       ListTypes:      StrictExportTypes
-                       ListAttributes: True
-                       Warnings:       True
-                       Verbose:        True
-                       ReadableABC:    False
-                       ReuseUniqueNodes:       True
-                       Fusion: False
+Version: 1.4\r
+Global\r
+       ProjectRoot:    .\r
+       Built:  False\r
+       Target: Clean Platform\r
+       Exec:   {Project}\skeleton6a.exe\r
+       CodeGen\r
+               CheckStacks:    False\r
+               CheckIndexes:   True\r
+       Application\r
+               HeapSize:       2097152\r
+               StackSize:      512000\r
+               ExtraMemory:    8192\r
+               IntialHeapSize: 204800\r
+               HeapSizeMultiplier:     4096\r
+               ShowExecutionTime:      False\r
+               ShowGC: False\r
+               ShowStackSize:  False\r
+               MarkingCollector:       False\r
+               StandardRuntimeEnv:     True\r
+               Profile\r
+                       Memory: False\r
+                       MemoryMinimumHeapSize:  0\r
+                       Time:   False\r
+                       Stack:  False\r
+               Output\r
+                       Output: NoReturnType\r
+                       Font:   Monaco\r
+                       FontSize:       9\r
+                       WriteStdErr:    False\r
+       Link\r
+               LinkMethod:     Dynamic\r
+               GenerateRelocations:    False\r
+               GenerateLinkMap:        False\r
+               LinkResources:  False\r
+               ResourceSource: \r
+               GenerateDLL:    False\r
+               ExportedNames:  \r
+       Paths\r
+               Path:   {Project}\r
+               Path:   {Application}\lib\clean-platform\OS-Independent\\r
+               Path:   {Application}\lib\Generics\r
+               Path:   {Application}\lib\Dynamics\r
+       Precompile:     \r
+       Postlink:       \r
+MainModule\r
+       Name:   skeleton6a\r
+       Dir:    {Project}\r
+       Compiler\r
+               NeverMemoryProfile:     False\r
+               NeverTimeProfile:       False\r
+               StrictnessAnalysis:     True\r
+               ListTypes:      StrictExportTypes\r
+               ListAttributes: True\r
+               Warnings:       True\r
+               Verbose:        True\r
+               ReadableABC:    False\r
+               ReuseUniqueNodes:       True\r
+               Fusion: False\r
+OtherModules\r
+       Module\r
+               Name:   Control.Applicative\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Control.Monad\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Either\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Foldable\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Func\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Functor\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.List\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Map\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Maybe\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Monoid\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Set\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Traversable\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Tuple\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Data.Void\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   System.IO\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Text\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Text.JSON\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   Text.PPrint\r
+               Dir:    {Application}\lib\clean-platform\OS-Independent\\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   GenEq\r
+               Dir:    {Application}\lib\Generics\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   _SystemDynamic\r
+               Dir:    {Application}\lib\Dynamics\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdArray\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdBool\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdChar\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdCharList\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdClass\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdEnum\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdEnv\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdFile\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdFunc\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdGeneric\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdInt\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdList\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdMisc\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdOrdList\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdOverloaded\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdOverloadedList\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdReal\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdStrictLists\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdString\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdTuple\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   _SystemArray\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   _SystemEnum\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   _SystemEnumStrict\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   _SystemStrictLists\r
+               Dir:    \r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
diff --git a/a9/charlie/Main.hs b/a9/charlie/Main.hs
new file mode 100644 (file)
index 0000000..a58359c
--- /dev/null
@@ -0,0 +1,127 @@
+{-#LANGUAGE GADTs #-}\r
+{-#LANGUAGE StandaloneDeriving #-}\r
+\r
+-- Mart Lubbers s4109503\r
+-- Charlie Gerhardus s3050009\r
+\r
+-- for union and intersect\r
+import Data.List\r
+\r
+-- type aliases and data structures\r
+type Ident = String\r
+type Set = Expr [Int]\r
+type Elem = Expr Int\r
+data Op = Add |Sub | Mul deriving Show\r
+data Val = Error String | IVal Int | ISVal [Int] deriving Show\r
+type State = [(String, Val)]\r
+data Sem a = Sem (State -> (a, State))\r
+\r
+-- the expression GADT\r
+data Expr a where\r
+    New :: Set\r
+    Ins :: Elem -> Set -> Set\r
+    Del :: Elem -> Set -> Set\r
+    Var :: Ident -> Expr a\r
+    Union :: Set -> Set -> Set\r
+    Diff :: Set -> Set -> Set\r
+    Intersect :: Set -> Set -> Set\r
+    Lit :: Int -> Elem\r
+    Size :: Set -> Elem\r
+    Oper :: Elem -> Op -> Elem -> Elem\r
+    Store :: Ident -> Expr a -> Expr a\r
+\r
+-- make it printable\r
+deriving instance Show (Expr a)\r
+\r
+-- Execute Sem by applying state\r
+execSem :: Sem a -> State -> (a, State)\r
+execSem (Sem f) st = f st\r
+\r
+-- Apply result to functor and preserve state\r
+mapSem :: (a -> b) -> (a, State) -> (b, State)\r
+mapSem f (x, st) = (f x, st)\r
+\r
+-- Functor instance for monad\r
+instance Functor Sem where\r
+    fmap f (Sem g) = Sem $ \st -> let (x, st') = g st in (f x, st')\r
+\r
+-- Applicative instance for monad\r
+instance Applicative Sem where\r
+    pure x = Sem $ \st -> (x, st)\r
+    Sem f <*> (Sem g) = Sem $ \st -> let (h, st') = f st in mapSem h (g st')\r
+\r
+-- The monad\r
+instance Monad Sem where\r
+    Sem f >>= g = Sem $ \st -> let (x, st') = f st in execSem (g x) st'\r
+\r
+-- Read a variable\r
+varRead :: String -> Sem Val\r
+varRead id = Sem $ \st -> maybe (Error "undefined variable reference!", st) (\v -> (v, st)) (lookup id st)\r
+\r
+-- Var write\r
+varWrite :: String -> Val -> Sem Val\r
+varWrite id v = Sem $ \st -> (v, (id, v):st)\r
+\r
+-- fail\r
+expFail :: String -> Sem Val\r
+expFail msg = Sem $ \st -> (Error msg, st)\r
+\r
+-- insert value into set\r
+setInsert :: Val -> Val -> Sem Val\r
+setInsert (ISVal is) (IVal i) = Sem $ \st -> (ISVal (i:is), st)\r
+setInsert _ _ = expFail "insert fail!"\r
+\r
+-- remove value from set\r
+setDelete :: Val -> Val -> Sem Val\r
+setDelete (ISVal is) (IVal i) = Sem $ \st -> (ISVal (delete i is), st)\r
+setDelete _ _ = expFail "delete fail!"\r
+\r
+-- set union\r
+setUnion :: Val -> Val -> Sem Val\r
+setUnion (ISVal is1) (ISVal is2) = Sem $ \st -> (ISVal (union is1 is2), st)\r
+setUnion _ _ = expFail "union fail!"\r
+\r
+-- set difference\r
+setDiff :: Val -> Val -> Sem Val\r
+setDiff (ISVal is1) (ISVal is2) = Sem $ \st -> (ISVal (is1 \\ is2), st)\r
+setDiff _ _ = expFail "difference fail!"\r
+\r
+-- set intersection\r
+setIntersect :: Val -> Val -> Sem Val\r
+setIntersect (ISVal is1) (ISVal is2) = Sem $ \st -> (ISVal (intersect is1 is2), st)\r
+setIntersect _ _ = expFail "intersection fail!"\r
+\r
+-- set size\r
+setSize :: Val -> Sem Val\r
+setSize (ISVal is) = Sem $ \st -> (IVal (length is), st)\r
+setSize _ = expFail "size fail!"\r
+\r
+-- integer operation\r
+intOper :: Val -> Op -> Val -> Val\r
+intOper (IVal i1) Add (IVal i2) = IVal (i1+i2)\r
+intOper (IVal i1) Sub (IVal i2) = IVal (i1-i2)\r
+intOper (IVal i1) Mul (IVal i2) = IVal (i1*i2)\r
+intOper _ _ _ = Error "Invalid integer operation!"\r
+\r
+-- Evaluate expression\r
+eval :: Expr a -> Sem Val\r
+eval New = Sem $ \st -> (ISVal [], st)\r
+eval (Ins e exp) = eval exp >>= \set -> eval e >>= \el -> setInsert set el\r
+eval (Del e exp) = eval exp >>= \set -> eval e >>= \el -> setDelete set el\r
+eval (Union exp1 exp2) = eval exp1 >>= \s1 -> eval exp2 >>= \s2 -> setUnion s1 s2\r
+eval (Diff exp1 exp2) = eval exp1 >>= \s1 -> eval exp2 >>= \s2 -> setDiff s1 s2\r
+eval (Intersect exp1 exp2) = eval exp1 >>= \s1 -> eval exp2 >>= \s2 -> setIntersect s1 s2\r
+eval (Lit i) = Sem $ \st -> (IVal i, st)\r
+eval (Var id) = varRead id\r
+eval (Size exp) = eval exp >>= setSize\r
+eval (Oper exp1 op exp2) = eval exp1 >>= \l -> eval exp2 >>= \r -> Sem $ \st -> (intOper l op r, st)\r
+eval (Store id exp) = eval exp >>= varWrite id\r
+\r
+-- expression without error\r
+e = Store "y" (Ins (Lit 4) (Union (Ins (Lit 8) New) (Ins (Store "x" (Lit 55)) New)))\r
+\r
+-- expression with error\r
+--e = Size (Lit 1)\r
+\r
+-- entry point\r
+main = putStrLn (show (execSem (eval e) []))\r
index 4d283ed..465a696 100644 (file)
@@ -1,3 +1,6 @@
+// Mart Lubbers s4109503\r
+// Charlie Gerhardus s3050009\r
+\r
 module skeleton9\r
 //One does not go over 80chars.\r
 //the true lambda character is the .\r