Skip to content

Instantly share code, notes, and snippets.

View epost's full-sized avatar

Erik Post epost

View GitHub Profile

Manually overriding the typeclass dictionary in Purescript

The reifySymbol from the purescript-symbols package

In my effort to understand the recently added RowToList Purescript feature, I have been reading Liam Goodacre's post, which made me take a closer look at the purescript-symbols package.

I was puzzled by the implementation of the reifySymbol function. Here it is:

@amosr
amosr / House.v
Last active September 11, 2019 10:45
Coq text adventure
Set Implicit Arguments.
Inductive Place
:= Kitchen | Bedroom | Hallway | Outside.
Inductive Card := NORTH | EAST | SOUTH | WEST.
Definition moveTo (p : Place) (c : Card) : option Place :=
match p, c with
test = map ((*) 2) >>> filter ((>) 15) >>> drop 3 >>> map show
src1 = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
src2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
res1 = transduce' test src1 :: [String]
res2 = transduce' test src2 :: List String