-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ prelude ] Add some lacking
%tcinline
s
- Loading branch information
Showing
6 changed files
with
76 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
%default total | ||
|
||
data X : Type -> Type -> Type where | ||
B : b -> X a b | ||
R : X a b -> X b c -> X a c | ||
|
||
[WithFunction] Functor (X a) where | ||
map f $ B x = B $ f x | ||
map f $ R x y = R x (map f y) | ||
|
||
[WithInfix] Functor (X a) where | ||
map f $ B x = B $ f x | ||
map f $ R x y = R x (f <$> y) | ||
|
||
[WithFoldMap] Foldable (X a) where | ||
|
||
foldr = ?some_foldr_1 | ||
|
||
foldMap f $ B x = f x | ||
foldMap f rlr@(R l r) = do | ||
let r' = map @{WithFunction} f r | ||
foldMap id $ assert_smaller rlr r' | ||
|
||
[WithConcat] Foldable (X a) where | ||
|
||
foldr = ?some_foldr_2 | ||
|
||
foldMap f $ B x = f x | ||
foldMap f rlr@(R l r) = do | ||
let r' = map @{WithFunction} f r | ||
concat $ assert_smaller rlr r' |
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 @@ | ||
1/1: Building Check (Check.idr) |
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,3 @@ | ||
rm -rf build | ||
|
||
$1 --no-color --console-width 0 --no-banner --check Check.idr |
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 @@ | ||
package a-test |