diff --git a/d4golf.hs b/d4golf.hs index 2b4d59b..9dd629c 100644 --- a/d4golf.hs +++ b/d4golf.hs @@ -1,18 +1,16 @@ import Data.Either e=[]:e +j=all i a=m.m.m.k -h=any$all i w p=head.rights.p -a?b|c a,i b=b|let=l 0 -k d i|i==l d=r d|let=i +k d i|i==l d=pure d|let=i +a?b|(not.i)a,i b=b|let=l 0 (x:y)#f=m(x!)(a x f):y#a x f a&x|(u,_:v)<-break(==x)a=u:v&x|let=[a] p(x:(_:y))=m read(x&',')#(m(m(l.read).words)y&[]) -x!d|h d||h(foldr(z(:))e d)=r$(x*)$sum$lefts=<z(?)(last b)h).span(any c))<*>w(filter i=<<)).p.lines +x!d|any j d||any j(foldr(z(:))e d)=pure$(x*)$sum$lefts=<z(?)(last b)h).break j)<*>w(filter i=<<)).p.lines m=map -r=pure l=Left -c=isLeft z=zipWith i=isRight \ No newline at end of file