-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b691f62
commit 8e74f4b
Showing
12 changed files
with
93 additions
and
22 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Juvix.Data.ProjectionKind where | ||
|
||
import Juvix.Prelude.Base | ||
|
||
data ProjectionKind | ||
= -- | Projection for regular fields | ||
ProjectionExplicit | ||
| -- | Projection for instance fields | ||
ProjectionCoercion | ||
deriving stock (Show, Eq, Ord, Generic) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
module InstanceFields; | ||
|
||
type T := t; | ||
|
||
type R := r; | ||
trait | ||
type Functor (f : Type -> Type) := | ||
mkFunctor { | ||
map : {A B : Type} -> (A -> B) -> f A -> f B | ||
}; | ||
|
||
trait | ||
type HasT (y : Type) := | ||
hasT { | ||
giveT : T | ||
type Applicative (f : Type -> Type) := | ||
mkApplicative { | ||
{{ApplicativeFunctor}} : Functor f; | ||
pure : {A : Type} -> A -> f A; | ||
ap : {A B : Type} -> f (A -> B) -> f A -> f B | ||
}; | ||
|
||
trait | ||
type HasR (x : Type) := | ||
hasR { | ||
{{fieldHasT}} : HasT x; | ||
type Monad (f : Type -> Type) := | ||
mkMonad { | ||
{{MonadApplicative}} : Applicative f; | ||
bind : {A B : Type} -> f A -> (A -> f B) -> f B | ||
}; | ||
|
||
open Functor; | ||
open Applicative; | ||
open Monad; | ||
|
||
monadMap {A B} {f : Type -> Type} {{Monad f}} (g : A -> B) (x : f A) : f B := map g x; |