History

Initial structure

TT types and values, some text manipulation, basics of Core

Edwin Brady committed 7 years ago

Commit 082bc5cNo parent (first commit)18 files · +3139 −0Browse files

Showing the changes to src/Control (1 of 18 files). Show all

Unified · Split

src/Control/Delayed.idr+26−0
@@ -0,0 +1,26 @@
1||| Utilities functions for contitionally delaying values.
2module Control.Delayed
3
4%default total
5
6||| Type-level function for a conditionally delayed type (`Lazy` or `Inf`).
7public export
8delayed : DelayReason -> Bool -> Type -> Type
9delayed r False a = a
10delayed r True a = Delayed r a
11
12||| Type-level function for a conditionally infinite type.
13public export
14inf : Bool -> Type -> Type
15inf = delayed Infinite
16
17||| Type-level function for a conditionally lazy type.
18public export
19lazy : Bool -> Type -> Type
20lazy = delayed LazyValue
21
22||| Conditionally delay a value.
23export
24delay : (d : Bool) -> a -> delayed r d a
25delay False x = x
26delay True x = Delay x

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t