Interpreting δ
as the least fixed point of the nullability equations, ascending from ⊥ = false
.
Given S → ϵ ∪ S
,
The zeroth iteration is ⊥
:
δ⁰(S) = ⊥ = false
The first is computed:
My life's yours, love | |
That's why you'll find, somebody's on my mind | |
Wants the world to know | |
And my hair ain't curled | |
But youre so mean to me, baby, I know youre gonna drive me away | |
Some call me honey | |
Like an old sweet song, 'The Lasting Time' | |
Some tell me "Billie, |
// cc autotes.m -o autotes -framework Foundation -fobjc-arc && ./autotes | |
#import <Foundation/Foundation.h> | |
// use it like lambda(…args…)(…return value…) | |
#define lambda(...) \ | |
^(__VA_ARGS__) _lambda_body | |
#define _lambda_body(...) \ | |
{ return __VA_ARGS__; } |
((w ord)) | |
((w) (ord)) | |
((word)) | |
((wo rd)) | |
((w o rd)) | |
((w o r d)) | |
((w o r) (d)) | |
((w o) (rd)) | |
((w o) (r d)) | |
((wo) (rd)) |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
int i = 10; | |
while (i \ | |
\ | |
\ | |
\ | |
--> 0) { printf("%i\n", i); } | |
return EXIT_SUCCESS; |
Interpreting δ
as the least fixed point of the nullability equations, ascending from ⊥ = false
.
Given S → ϵ ∪ S
,
The zeroth iteration is ⊥
:
δ⁰(S) = ⊥ = false
The first is computed:
Interpreting parseNull
as the least fixed point of the parse null equations, ascending from ⊥ = {}
Given S → ϵ↓{x} ∪ S
,
The zeroth iteration is ⊥
:
parseNull⁰(S) = ⊥ = {}
The first is computed:
a |
b |
a && b |
---|---|---|
👎 | 👎 | 👎 |
👍 | 👎 | 👎 |
👎 | 👍 | 👎 |
👍 | 👍 | 👍 |
a |
b |
a && b |
---|---|---|
👎 | 👎 | 👎 |
👍 | 👎 | 👎 |
👎 | 👍 | 👎 |
👍 | 👍 | 👍 |
newtype Term f = In { out :: f (Term f) } | |
-- The trivial one | |
type RCoalgebra1 f a = a -> f (Either (Term f) a) | |
apo1 :: Functor f => RCoalgebra1 f a -> a -> Term f | |
apo1 f = In . (fmap fanin) . f | |
where fanin = either id (apo1 f) | |
data Parser a where | |
Cat :: Parser a -> Parser b -> Parser (a, b) | |
Alt :: Parser a -> Parser b -> Parser (Either a b) | |
Rep :: Parser a -> Parser [a] | |
Map :: Parser a -> (a -> b) -> Parser b | |
Bnd :: Parser a -> (a -> Parser b) -> Parser b | |
Lit :: Char -> Parser Char | |
Ret :: [a] -> Parser a | |
Nul :: Parser a | |
Eps :: Parser a |