File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
hackett-lib/hackett/private
hackett-test/tests/hackett Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 327327 (values (listof (cons/c identifier? type?))
328328 (-> (listof identifier?) (values syntax? (listof identifier?)))))
329329 (let-values ([(t_⇒ assumps mk-pat) (pat⇒! pat)])
330- (type<:! t_⇒ t #:src (pat-base-stx pat))
330+ (type<:! t t_⇒ #:src (pat-base-stx pat))
331331 (values assumps mk-pat)))
332332
333333 ; Combines a list of `match` pattern constructors to properly run them against a list of identifiers
Original file line number Diff line number Diff line change 1+ #lang hackett
2+ (require hackett/data/identity)
3+
4+ (data (Lens s t a b)
5+ (L (∀ [f] (Functor f) => {{a -> (f b)} -> {s -> (f t)}})))
6+
7+ (defn make-lens : (∀ [s t a b] {{s -> a} -> {s -> b -> t} -> (Lens s t a b)})
8+ [[get set]
9+ (L (λ [afb s]
10+ {(set s) <$> (afb (get s))}))])
11+
12+ (defn modify : (∀ [s t a b] {(Lens s t a b) -> {a -> b} -> {s -> t}})
13+ [[(L l) func s]
14+ (run-identity (l {Identity . func} s))])
Original file line number Diff line number Diff line change 1+ #lang hackett
2+
3+ (data Nop
4+ (nop (∀ [a] {a -> a})))
5+ (defn ->nop : (∀ [a] {a -> Nop -> a})
6+ [[x (nop f)] (f x)])
You can’t perform that action at this time.
0 commit comments