-
Following @nobeh comment in #15
> Let's consider this psuedo/modelling code:
>
> ```
> data Map = EmptyMap | InsertAssoc(Pair, Map);
> ```
>
> which defines a `Map` data structure in ADT composed …
-
Together with polymorphism (#5), this would allow use to write functions like `fold()`.
-
This proposal seems great in conjunction with @bterlson's pattern matching proposal. In particular, using sealed object (and maybe array) literals is a good way to assert that there is nothing else, w…
-
For now, this is just a placeholder issue so that we don't lose track of this feature, but we would obviously like to support more flexible patterns than we currently do. Specifically, we would like t…
dhess updated
7 months ago
-
## Description
Maybe i encountered an issue while generating documentation using the YARD gem with pattern matching syntax like "foo" => String. A `RangeError` is thrown regarding a 'beginless range…
-
Example:
```
type t =
| Foo
| Bar
| Foobar of t * t
let rec just_id = function
| Foo -> Foo
| Bar -> Bar
| Foobar (t0, t1) -> Foobar (just_id t0, just_id t1)
```
Produced `cmm…
riaqn updated
4 months ago
-
Example:
```
type (_, _) eq =
| Refl : ('a, 'a) eq
type 'a t =
| String : string t
| Int : int t
| Float : float t
let eq: type a b. a t -> b t -> (a, b) eq option
= fun a b ->
…
riaqn updated
4 months ago
-
``` Coq
IHt1 : forall T : ty, tycheck t1 T = true -> |-t1 \in T
Heqn : tycheck t1 TBool = true
Ltac trans_to_rel_OK :=
match goal with
H1 : forall x, ?P x = true -> ?P2 x , H2 : ?P ?X = true |-_ =>…
-
Motivations:
- Allows for better type inference
- Facilitates pattern matching
- Cleaner code through elimination of `try`/`catch` logic
- Throwing exceptions are generally regarded as an antipa…
-
See `PatternMatching.matches` and its `matching_pattern_against_pattern` argument.