From: Mart Lubbers Date: Sun, 2 Dec 2018 10:25:56 +0000 (+0100) Subject: levenstein segfault X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=refs%2Fheads%2Flevenstein;p=advent18.git levenstein segfault --- diff --git a/2/s2.icl b/2/s2.icl index fe363bf..72d2ba6 100644 --- a/2/s2.icl +++ b/2/s2.icl @@ -3,6 +3,7 @@ module s2 import StdEnv import Data.Func import Data.List +import Debug.Trace getinput :: [Char] *File -> [[Char]] getinput a f @@ -20,4 +21,6 @@ Start w $ getinput [] io proc [] = [] -proc [x:xs] = [[(e, x)\\e<-xs | length [()\\a<-x & b<-e | a<>b] <= 1]:proc xs] +proc [x:xs] = [[(e, x)\\e<-xs | levenshtein` x e <= 1]:proc xs] + +levenshtein` a b = levenshtein (trace_stdout a) (trace_stdout b)