Skip to content

Commit dcdfeac

Browse files
committed
−3 characters
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
1 parent 3f7964b commit dcdfeac

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

TinyLambda-minimized.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
data T=T{a::T->T,(%)::ShowS}
22
i d=T(i. \x v->'(':d v++' ':x%v++")")d
33
l f v=""++v++". "++f(i(\_->v))%('x':v)++")"
4-
o(f,n)=f[]%"x"++n
5-
p=q.head.lex
6-
q("(",'λ':s)|[(w,_:t)]<-lex s,(b,_:u)<-p t=(\e->T<*>l$b.(:e).(,)w,u)
7-
q("(",s)|(f,t)<-p s,(x,_:u)<-p t=(a.f<*>x,u)
8-
q(v,s)=(foldl1 a.lookup v,s)
9-
main=interact$o.p
4+
(?)=q.head.lex
5+
q("(",'λ':s)k|[(w,_:t)]<-lex s=t? \b(_:u)->k(\e->T<*>l$b.(:e).(,)w)u
6+
q("(",s)k=s? \f->(? \x(_:u)->k(a.f<*>x)u)
7+
q(v,s)k=k(foldl1 a.lookup v)s
8+
main=interact(? \f->(f[]%"x"++))

0 commit comments

Comments
 (0)