« first day (141 days earlier)      last day (1822 days later) » 

06:29
18
Q: Repeat after me!

Super ChafouinGiven a string as argument, output the length of the longest(s) non-overlapping repeated substring(s) or zero if there is no such string. You can assume the input string is not empty. Examples abcdefabc : the substring abc is repeated at positions 1 and 7, so the program should output 3 abcab...

That question has no Haskell answer yet.
I'd be interested to see what people come up with.
07:16
Well here's my answer. Hopefully people can beat that.
 
5 hours later…
12:17
@BMO I think this particular find is interesting enough to warrant an answer. Do you want to write it up?
BMO
BMO
12:46
@Laikoni: I agree, but I think it should be yours to post.
 
2 hours later…
14:31
@BMO Ok, posted.
BMO
BMO
15:18
Thx, for mentioning me :)
 
2 hours later…
BMO
BMO
17:05
TIL Haskell allows record syntax with multiple constructors o.O
This just feels horrible..
It looks so innocent and I just checked -Wall doesn't even give a warning.
17:40
@BMO It throws an exception No match in record selector partial1
BMO
BMO
That's what I mean, it fails at runtime without giving a warning
The equivalent gives a compiler warning and you can tell that it's a partial function..
Well, now I can tell for the other one as well :)
Ah, now I see what you mean.
Yeah, warning would be nice in such a case.
BMO
BMO
I guess they didn't think anyone would be so stupid to do this, hehe
BMO
BMO
18:00
Actually maybe it could make a bit sense, in certain cases: Try it online!
But I'd probably write partial1 explicitly in that case, not sure
18:16
Is there a better way to do fromInteger.toInteger?
Ah its called fromIntegral
 
2 hours later…
BMO
BMO
19:47
@WheatWizard: Maybe read.show could work as mentioned in this tip?
(or rather the comment below)
Oh yeah, that could work

« first day (141 days earlier)      last day (1822 days later) »