{"id":16488742,"url":"https://github.com/bts/nicta-course","last_synced_at":"2025-10-18T01:29:39.626Z","repository":{"id":16801477,"uuid":"19560255","full_name":"bts/nicta-course","owner":"bts","description":"NICTA haskell course solutions","archived":false,"fork":false,"pushed_at":"2014-07-14T01:33:36.000Z","size":3236,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T17:48:16.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bts.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-08T04:14:36.000Z","updated_at":"2014-09-02T13:15:54.000Z","dependencies_parsed_at":"2022-09-05T09:10:19.892Z","dependency_job_id":null,"html_url":"https://github.com/bts/nicta-course","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fnicta-course","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fnicta-course/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fnicta-course/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fnicta-course/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bts","download_url":"https://codeload.github.com/bts/nicta-course/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241306548,"owners_count":19941320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T13:39:48.556Z","updated_at":"2025-10-18T01:29:39.514Z","avatar_url":"https://github.com/bts.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Functional Programming Course\n\n![NICTA](http://i.imgur.com/sMXB9XB.jpg)\n\n### Written by Tony Morris \u0026 Mark Hibberd for NICTA\n\n### With contributions from individuals (thanks!)\n\n#### Special note\n\nIf you have arrived here by https://github.com/tonymorris/course and you are\nlooking for the *exercises* (not the answers), please go to\nhttps://github.com/NICTA/course\n\n#### Introduction\n\nThe course is structured according to a linear progression and uses the Haskell\nprogramming language to learn programming concepts pertaining to functional\nprogramming.\n\nExercises are annotated with a comment containing the word \"Exercise.\" The existing code compiles, however answers have\nbeen replaced with a call to the Haskell `error` function and so the code will throw an exception if it is run. Some\nexercises contain tips, which are annotated with a preceding \"Tip:\". It is not necessary to adhere to tips. Tips are\nprovided for potential guidance, which may be  discarded.\n\nThe exercises are designed in a way that requires personal guidance, so if you\nattempt it on your own and feel a little lost, this is normal. All the\ninstructions are not contained herein.\n\n### Getting Started\n\n1. Install the Glasgow Haskell Compiler (GHC) version 7.6 or higher.\n\n2. Change to the directory containing this document.\n\n3. Execute the command `ghci`, which will compile and load all the source code.\n   You may need to set permissions on a file, `chmod 600 .ghci`.\n\n4. The `Intro` module does not contain exercises. Its purpose is to demonstrate\n   the structure of a project. The first recommend exercise is `Course.List`.\n\n5. Edit a source file to a proposed solution to an exercise. At the `ghci`\n   prompt, issue the command `:reload`. This will compile your solution and\n   reload it in the GHC interpreter. You may use `:r` for short.\n\n### Tips after having started\n\n1. Some questions take a particular form. These are called *WTF questions*. WTF\n   questions are those of this form or similar:\n  * What does ____ mean?\n  * What does the ____ function mean?\n  * What is a ____ ?\n  * Where did ____ come from ?\n  * What is the structure of ____ ?\n\n  They are all answerable with the `:info` command. For example, suppose you\n  have the question, \"What does the `swiggletwoop` function mean?\" You may\n  answer this at GHCi with:\n\n  `\u003e :info swiggletwoop`\n\n  You may also use `:i` for short.\n\n2. Functional Programming techniques rely heavily on types. This reliance may\n   feel foreign at first, however, it is an important part of this course. If\n   you wish to know the type of an expression or value, use `:type`. For\n   example,\n\n   `\u003e :type reverse`\n\n   `[t] -\u003e [t]`\n\n   This tells you that the `reverse` function takes a list of elements of some\n   arbitrary type (`t`) and returns a list of elements of that same type. Try\n   it.\n\n   You may also use `:t` for short.\n\n3. GHCi has TAB-completion. For example you might type the following:\n\n   `\u003e :type rev`\n\n   Now hit the TAB key. If there is only one function in scope that begins with\n   the characters `rev`, then that name will auto-complete. Try it. This\n   completion is context-sensitive. For example, it doesn't make sense to ask\n   for the type of a data type itself, so data type names will not auto-complete\n   in that context, however, if you ask for `:info`, then they are included in\n   that context. Be aware of this when you use auto-complete.\n\n   This also works for file names:\n\n   `\u003e readFile \"/etc/pas\"`\n\n   Now hit the TAB key. If there is only one existing filename on a path that\n   begins with `/etc/pas`, then that name will auto-complete. Try it.\n\n   If there is more than one identifier that can complete, hit TAB twice\n   quickly. This will present you with your options to complete.\n\n4. Follow the types.\n\n   You may find yourself in a position of being unsure how to proceed for a\n   given exercise. You are encouraged to adopt a different perspective. Instead\n   of asking how to proceed, ask how you might proceed while adhering to the\n   guideline provided by the types for the exercise at hand.\n\n   It is possible to follow the types without achieving the desired goal,\n   however, this is reasonably unlikely at the start. As you become more reliant\n   on following the types, you will develop more trust in the potential paths\n   that they can take you, including identification of false paths.\n\n   Your instructor must guide you where types fall short, but you should also\n   take the first step. Do it.\n\n#### Running the tests\n\nSome exercises include examples and properties, which appear in a comment above\nthe code for that exercise. Examples begin with `\u003e\u003e\u003e` while properties begin\nwith `prop\u003e`.\n\nThe solution to the exercise must satisfy these tests. You can check if you have\nsatisfied all tests with cabal-install and doctest. From the base directory of\nthis source code:\n\n    \u003e cabal update\n    \u003e cabal install cabal-install\n    \u003e cabal install --only-dependencies\n    \u003e cabal configure --enable-tests\n    \u003e cabal build\n    \u003e cabal test\n\nAlternatively, you may run the tests in a single source file by using `doctest`\nexplicitly. From the base directory of this source code:\n\n    \u003e doctest -isrc -Wall -fno-warn-type-defaults \u003cfilename.hs\u003e\n\nNote: There is a [bug in GHC 7.4.1](http://ghc.haskell.org/trac/ghc/ticket/5820)\nwhere for some configurations, running the tests will cause an unjustified\ncompiler error.\n\n### Progression\n\nIt is recommended to perform some exercises before others. The first step is to inspect the introduction modules.\n\n* `Course.Id`\n* `Course.Optional`\n* `Course.Validation`\n\nThey contain examples of data structures and Haskell syntax. They do not contain exercises and exist to provide \na cursory examination of Haskell syntax. The next step is to complete the exercises in `Course.List`.\n\nAfter this, the following progression of modules is recommended:\n\n* `Course.Functor`\n* `Course.Apply`\n* `Course.Applicative`\n* `Course.Bind`\n* `Course.Monad`\n* `Course.FileIO`\n* `Course.State`\n* `Course.StateT`\n* `Course.Extend`\n* `Course.Comonad`\n* `Course.ListZipper`\n* `Course.Parser`\n* `Course.MoreParser`\n* `Course.JsonParser`\n* `Course.Interactive`\n* `Course.Anagrams`\n* `Course.FastAnagrams`\n* `Course.EditDistance`\n* `Course.BKTree`\n* `Course.Cheque`\n\nAfter these are completed, complete the exercises in the `projects` directory.\n\n### References\n\n* [The Haskell `error` function](http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#v:error)\n\n* [Glasgow Haskell Compiler](http://haskell.org/ghc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbts%2Fnicta-course","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbts%2Fnicta-course","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbts%2Fnicta-course/lists"}