Skip to content

Instantly share code, notes, and snippets.

@sellout
Created April 11, 2014 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sellout/10505377 to your computer and use it in GitHub Desktop.
Save sellout/10505377 to your computer and use it in GitHub Desktop.
scanl : (b -> a -> b) -> b -> Vect n a -> Vect (S n) b
scanl f q ls = q :: (case ls of
[] => []
x::xs => scanl f (f q x) xs)
-- When elaborating left hand side of Main.case block in scanl:
-- When elaborating argument ls to Main.case block in scanl:
-- Can't unify
-- Vect 0 a
-- with
-- Vect n a
--
-- Specifically:
-- Can't unify
-- 0
-- with
-- n
@sellout
Copy link
Author

sellout commented Apr 11, 2014

bitsToFin : Bits n -> Fin (power 2 n)
bitsToFin = fromInteger . bitsToInt

causes

When elaborating right hand side of bitsToFin:
Can't resolve type class Num (Fin (power 2 n))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment