Skip to content

Instantly share code, notes, and snippets.

{- |
DESCRIPTION
This program parses valid NRICs from text.
NRICs are unique identification numbers given to Singaporeans and Permanent residents of Singapore.
SYSTEM
This runs on GHC 8.10.1
These libraries should be included with your GHC distribution:
@kwannoel
kwannoel / agda.nix
Created July 6, 2020 15:52
Nix shell for agda
# Adapted from @ryanorendorff's gist: https://gist.github.com/ryanorendorff/f5c96d9f363a0e390425c2d9588bbb9d
{ pkgs ? import <nixos> {} }:
let
# The standard library in nixpkgs does not come with a *.agda-lib file, so we
# generate it here.
standard-library-agda-lib = pkgs.writeText "standard-library.agda-lib" ''
name: standard-library
include: ${pkgs.AgdaStdlib}/share/agda
-- stack --system-ghc runghc
{- |
Result of pair programming with [bumbleblym](https://github.com/bumbleblym)
He implemented most of the code below and suggested using parsers from base
rather than @getLine@ & @read@ to parse the input.
This increases code modularity and ease of refactoring.
Interesting parts: