Search Haskell Channel Logs

Wednesday, February 22, 2017

#haskell channel featuring thatguy, mauke, Koterpillar, APic, max3, lambdabot, and 6 others.

Jello_Raptor 2017-02-22 09:46:17
is there someone who has implemented easy atomic transations using MonadTransControl?
Jello_Raptor 2017-02-22 09:47:32
I've got a transformer stack over ID that should let you just gather up all the state, run a computation, if that computation errors then restore the state. I just don't want to write all the plumbing myself.
max3 2017-02-22 09:54:50
does anyone know how to get stack to look for source files outside of the current directory?
max3 2017-02-22 09:54:54
ghc-options: "*": -i /path/to/library doesn't work isn't working
Zemyla 2017-02-22 10:06:07
What are the changes between 4.9.0.0 and 4.9.1.0?
thatguy 2017-02-22 10:25:22
http://lpaste.net/352890 how would this go in nice?
erisco 2017-02-22 10:26:26
:t ord
lambdabot 2017-02-22 10:26:28
Char -> Int
erisco 2017-02-22 10:26:38
> map ord ['a'..'z']
lambdabot 2017-02-22 10:26:41
[97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,11...
erisco 2017-02-22 10:27:04
> map (subtract 96 . ord) ['a'..'z']
lambdabot 2017-02-22 10:27:07
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]
APic 2017-02-22 10:27:10
yay
Koterpillar 2017-02-22 10:27:14
> elemIndex ['a'..'z'] 'a'
lambdabot 2017-02-22 10:27:18
error:
lambdabot 2017-02-22 10:27:18
• Couldn't match expected type '[[Char]]' with actual type 'Char'
lambdabot 2017-02-22 10:27:18
• In the second argument of 'elemIndex', namely ''a''
Koterpillar 2017-02-22 10:27:39
> flip elemIndex ['a'..'z'] 'a'
lambdabot 2017-02-22 10:27:44
Just 0
erisco 2017-02-22 10:28:08
lol I suppose but how painfully slow
Koterpillar 2017-02-22 10:29:07
> map (subtract 96 . ord) 'а' -- but correct!
lambdabot 2017-02-22 10:29:10
error:
lambdabot 2017-02-22 10:29:10
• Couldn't match expected type '[Char]' with actual type 'Char'
lambdabot 2017-02-22 10:29:10
• In the second argument of 'map', namely ''\1072''
Koterpillar 2017-02-22 10:29:16
> (subtract 96 . ord) 'а' -- but correct!
lambdabot 2017-02-22 10:29:19
976
dmwit 2017-02-22 10:29:20
platz: What? Why? 0xFEFE works fine in Haskell, too.
dmwit 2017-02-22 10:29:23
> 0xFEFE
lambdabot 2017-02-22 10:29:27
65278
dmwit 2017-02-22 10:32:31
> '\xFEFE'
lambdabot 2017-02-22 10:34:35
'\65278'
thatguy 2017-02-22 10:34:35
ericbmerritt_, thanks
dmwit 2017-02-22 10:34:35
> "\xfeefifoefum \xfee\&fifoefum"
lambdabot 2017-02-22 10:34:35
"\65263ifoefum \4078fifoefum"
merijn 2017-02-22 10:34:35
use text
merijn 2017-02-22 10:34:35
To avoid show escaping
merijn 2017-02-22 10:34:35
> text "\xfeefifoefum \xfee\&fifoefum"
lambdabot 2017-02-22 10:34:35
ﻯifoefum ࿮fifoefum
dmwit 2017-02-22 10:34:35
merijn: But I want the escaping.
merijn 2017-02-22 10:34:35
ah
dmwit 2017-02-22 10:34:35
Oh, does `show` have to know about `\&`, too?
dmwit 2017-02-22 10:34:35
> "\0\&1"
lambdabot 2017-02-22 10:34:35
"\NUL1"
dmwit 2017-02-22 10:34:35
> "\6000\&1"
lambdabot 2017-02-22 10:34:35
"\6000\&1"
mauke 2017-02-22 10:34:35
> "\SO" ++ "H"
lambdabot 2017-02-22 10:34:35
"\SO\&H"
dmwit 2017-02-22 10:34:35
Yikes!
dmwit 2017-02-22 10:34:35
show is complicated =)
Tuplanolla 2017-02-22 10:34:35
Arithmetic on `Char`?