Skip to content

Instantly share code, notes, and snippets.

defmodule Impl do
defstruct value: 100
def runImpl(%Impl{value: value}, x, y) do
value + x + y
end
end
defprotocol Runnable do
def run(r, x, y)
{-# LANGUAGE TypeFamilies, GADTs #-}
data OfInt (f :: * -> *) where
OfInt :: f Int -> OfInt f
type family F a where
F a = Maybe a
runF :: F Int -> OfInt F
runF = OfInt {- Error on this line:
@dima-starosud
dima-starosud / Reduce.agda
Created December 6, 2014 10:58
One more: "I'm not sure if there should be a case for the constructor refl, because I get stuck when trying to solve the following unification problems"
open import Function
open import Relation.Binary.PropositionalEquality
open import Data.Product
open import Data.String
open import Data.Bool
open import Data.Unit
record Level : Set where
constructor level
field
@dima-starosud
dima-starosud / Term.agda
Last active August 29, 2015 14:10
I'm not sure if there should be a case for the constructor ..., because I get stuck when trying to solve the following unification problems
open import Function
open import Relation.Binary.PropositionalEquality
open import Data.Product
open import Data.String
open import Data.Bool
open import Data.Unit
record Level : Set where
constructor level
@dima-starosud
dima-starosud / Test.hs
Last active August 29, 2015 14:10
Pattern match(es) are non-exhaustive
{-# LANGUAGE DataKinds
, KindSignatures
, TypeFamilies
, GADTs
, TypeOperators
, ScopedTypeVariables
, MultiParamTypeClasses
, FlexibleInstances
, StandaloneDeriving
, RankNTypes