Skip to content

Instantly share code, notes, and snippets.

@edwinb
Created July 8, 2015 14:42
Show Gist options
  • Save edwinb/cba832b52152d6c376e9 to your computer and use it in GitHub Desktop.
Save edwinb/cba832b52152d6c376e9 to your computer and use it in GitHub Desktop.
Ragged arrays
import Data.Vect
data Ragged : List Nat -> Type -> Type where
Nil : Ragged [] a
(::) : Vect n a -> Ragged ns a -> Ragged (n :: ns) a
test_ragged : Ragged [1,3,2] String
test_ragged = [["Foo"],
["Bar", "Baz", "Quux"],
["Thurlingdrome", "Bananas"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment