From e345b77d68ee493cda16be00cd08b0529ed48021 Mon Sep 17 00:00:00 2001 From: charlie Date: Sun, 22 Nov 2015 19:56:35 +0100 Subject: [PATCH] added extra note --- a6/mart/skeleton6a.prj | 1352 ++++++++++++++++++++-------------------- a9/charlie/Main.hs | 127 ++++ a9/mart/skeleton9.icl | 3 + 3 files changed, 806 insertions(+), 676 deletions(-) create mode 100644 a9/charlie/Main.hs diff --git a/a6/mart/skeleton6a.prj b/a6/mart/skeleton6a.prj index 592a19b..563830b 100644 --- a/a6/mart/skeleton6a.prj +++ b/a6/mart/skeleton6a.prj @@ -1,676 +1,676 @@ -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 +Global + ProjectRoot: . + Built: False + Target: Clean Platform + Exec: {Project}\skeleton6a.exe + CodeGen + CheckStacks: False + CheckIndexes: True + Application + HeapSize: 2097152 + StackSize: 512000 + ExtraMemory: 8192 + IntialHeapSize: 204800 + HeapSizeMultiplier: 4096 + ShowExecutionTime: False + ShowGC: False + ShowStackSize: False + MarkingCollector: 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + Compiler + NeverMemoryProfile: False + NeverTimeProfile: False + StrictnessAnalysis: True + ListTypes: StrictExportTypes + ListAttributes: True + Warnings: True + Verbose: True + ReadableABC: False + ReuseUniqueNodes: True + Fusion: False diff --git a/a9/charlie/Main.hs b/a9/charlie/Main.hs new file mode 100644 index 0000000..a58359c --- /dev/null +++ b/a9/charlie/Main.hs @@ -0,0 +1,127 @@ +{-#LANGUAGE GADTs #-} +{-#LANGUAGE StandaloneDeriving #-} + +-- Mart Lubbers s4109503 +-- Charlie Gerhardus s3050009 + +-- for union and intersect +import Data.List + +-- type aliases and data structures +type Ident = String +type Set = Expr [Int] +type Elem = Expr Int +data Op = Add |Sub | Mul deriving Show +data Val = Error String | IVal Int | ISVal [Int] deriving Show +type State = [(String, Val)] +data Sem a = Sem (State -> (a, State)) + +-- the expression GADT +data Expr a where + New :: Set + Ins :: Elem -> Set -> Set + Del :: Elem -> Set -> Set + Var :: Ident -> Expr a + Union :: Set -> Set -> Set + Diff :: Set -> Set -> Set + Intersect :: Set -> Set -> Set + Lit :: Int -> Elem + Size :: Set -> Elem + Oper :: Elem -> Op -> Elem -> Elem + Store :: Ident -> Expr a -> Expr a + +-- make it printable +deriving instance Show (Expr a) + +-- Execute Sem by applying state +execSem :: Sem a -> State -> (a, State) +execSem (Sem f) st = f st + +-- Apply result to functor and preserve state +mapSem :: (a -> b) -> (a, State) -> (b, State) +mapSem f (x, st) = (f x, st) + +-- Functor instance for monad +instance Functor Sem where + fmap f (Sem g) = Sem $ \st -> let (x, st') = g st in (f x, st') + +-- Applicative instance for monad +instance Applicative Sem where + pure x = Sem $ \st -> (x, st) + Sem f <*> (Sem g) = Sem $ \st -> let (h, st') = f st in mapSem h (g st') + +-- The monad +instance Monad Sem where + Sem f >>= g = Sem $ \st -> let (x, st') = f st in execSem (g x) st' + +-- Read a variable +varRead :: String -> Sem Val +varRead id = Sem $ \st -> maybe (Error "undefined variable reference!", st) (\v -> (v, st)) (lookup id st) + +-- Var write +varWrite :: String -> Val -> Sem Val +varWrite id v = Sem $ \st -> (v, (id, v):st) + +-- fail +expFail :: String -> Sem Val +expFail msg = Sem $ \st -> (Error msg, st) + +-- insert value into set +setInsert :: Val -> Val -> Sem Val +setInsert (ISVal is) (IVal i) = Sem $ \st -> (ISVal (i:is), st) +setInsert _ _ = expFail "insert fail!" + +-- remove value from set +setDelete :: Val -> Val -> Sem Val +setDelete (ISVal is) (IVal i) = Sem $ \st -> (ISVal (delete i is), st) +setDelete _ _ = expFail "delete fail!" + +-- set union +setUnion :: Val -> Val -> Sem Val +setUnion (ISVal is1) (ISVal is2) = Sem $ \st -> (ISVal (union is1 is2), st) +setUnion _ _ = expFail "union fail!" + +-- set difference +setDiff :: Val -> Val -> Sem Val +setDiff (ISVal is1) (ISVal is2) = Sem $ \st -> (ISVal (is1 \\ is2), st) +setDiff _ _ = expFail "difference fail!" + +-- set intersection +setIntersect :: Val -> Val -> Sem Val +setIntersect (ISVal is1) (ISVal is2) = Sem $ \st -> (ISVal (intersect is1 is2), st) +setIntersect _ _ = expFail "intersection fail!" + +-- set size +setSize :: Val -> Sem Val +setSize (ISVal is) = Sem $ \st -> (IVal (length is), st) +setSize _ = expFail "size fail!" + +-- integer operation +intOper :: Val -> Op -> Val -> Val +intOper (IVal i1) Add (IVal i2) = IVal (i1+i2) +intOper (IVal i1) Sub (IVal i2) = IVal (i1-i2) +intOper (IVal i1) Mul (IVal i2) = IVal (i1*i2) +intOper _ _ _ = Error "Invalid integer operation!" + +-- Evaluate expression +eval :: Expr a -> Sem Val +eval New = Sem $ \st -> (ISVal [], st) +eval (Ins e exp) = eval exp >>= \set -> eval e >>= \el -> setInsert set el +eval (Del e exp) = eval exp >>= \set -> eval e >>= \el -> setDelete set el +eval (Union exp1 exp2) = eval exp1 >>= \s1 -> eval exp2 >>= \s2 -> setUnion s1 s2 +eval (Diff exp1 exp2) = eval exp1 >>= \s1 -> eval exp2 >>= \s2 -> setDiff s1 s2 +eval (Intersect exp1 exp2) = eval exp1 >>= \s1 -> eval exp2 >>= \s2 -> setIntersect s1 s2 +eval (Lit i) = Sem $ \st -> (IVal i, st) +eval (Var id) = varRead id +eval (Size exp) = eval exp >>= setSize +eval (Oper exp1 op exp2) = eval exp1 >>= \l -> eval exp2 >>= \r -> Sem $ \st -> (intOper l op r, st) +eval (Store id exp) = eval exp >>= varWrite id + +-- expression without error +e = Store "y" (Ins (Lit 4) (Union (Ins (Lit 8) New) (Ins (Store "x" (Lit 55)) New))) + +-- expression with error +--e = Size (Lit 1) + +-- entry point +main = putStrLn (show (execSem (eval e) [])) diff --git a/a9/mart/skeleton9.icl b/a9/mart/skeleton9.icl index 4d283ed..465a696 100644 --- a/a9/mart/skeleton9.icl +++ b/a9/mart/skeleton9.icl @@ -1,3 +1,6 @@ +// Mart Lubbers s4109503 +// Charlie Gerhardus s3050009 + module skeleton9 //One does not go over 80chars. //the true lambda character is the . -- 2.20.1