This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds | |
, KindSignatures | |
, TypeFamilies | |
, GADTs | |
, TypeOperators | |
, ScopedTypeVariables | |
, MultiParamTypeClasses | |
, FlexibleInstances | |
, StandaloneDeriving | |
, RankNTypes |