Skip to content

Instantly share code, notes, and snippets.

@TristanCacqueray
Created February 14, 2020 01:31
Show Gist options
  • Save TristanCacqueray/c37b27cd325e44ae073512e32db9a452 to your computer and use it in GitHub Desktop.
Save TristanCacqueray/c37b27cd325e44ae073512e32db9a452 to your computer and use it in GitHub Desktop.
{- The package contains common symbol shared by the other dhall files -}
let Prelude =
env:DHALL_PRELUDE
? https://prelude.dhall-lang.org/v13.0.0/package.dhall sha256:4aa8581954f7734d09b7b21fddbf5d8df901a44b54b4ef26ea71db92de0b1a12
let {- Generate sequence like unix seq command -} seq =
\(count : Natural)
-> let seq = Prelude.List.replicate count Natural 1
let indexed = Prelude.List.indexed Natural seq
let IndexedType = { index : Natural, value : Natural }
in Prelude.List.map
IndexedType
Natural
(\(index : IndexedType) -> index.index + 1)
indexed
let seq-test = assert : seq 5 === [ 1, 2, 3, 4, 5 ]
in seq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment