Search Haskell Channel Logs

Thursday, February 9, 2017

#haskell channel featuring lpaste_, dmwit, lambdabot, Squarism, markasoftware, fresheyeball,

qmm 2017-02-09 13:52:54
urlEncode $ False (BS.pack $ head mystrings) -- Couldn't match expected type 'BS.ByteString -> Bool' with actual type 'Bool'
qmm 2017-02-09 13:53:14
https://hackage.haskell.org/package/http-types-0.9.1/docs/src/Network-HTTP-Types-URI.html#urlEncode
Koterpillar 2017-02-09 13:53:18
qmm: urlEncode False $ BS.pack $ head mystrings
Koterpillar 2017-02-09 13:53:53
qmm: what you had was qmm (False (BS.pack (head mystrings)))
Koterpillar 2017-02-09 13:54:03
sorry, urlEncode (False (BS.pack (head mystrings)))
dmwit 2017-02-09 13:54:05
> f $ g $ x
lambdabot 2017-02-09 13:54:08
error:
lambdabot 2017-02-09 13:54:08
• Could not deduce (Show t0) arising from a use of 'f'
lambdabot 2017-02-09 13:54:08
from the context: FromExpr t
dmwit 2017-02-09 13:54:25
> f $ g x
lambdabot 2017-02-09 13:54:27
error:
lambdabot 2017-02-09 13:54:27
• Could not deduce (Show t0) arising from a use of 'f'
lambdabot 2017-02-09 13:54:27
from the context: FromExpr t
dmwit 2017-02-09 13:54:36
okay...
qmm 2017-02-09 13:54:38
Koterpillar: strange, i thought i had function x y
qmm 2017-02-09 13:54:59
urlEncode (False) (BS.pack...)
qmm 2017-02-09 13:56:17
oh, i just needed urlEncode False (BS.pack...)
Koterpillar 2017-02-09 13:56:34
that's what I suggested ^_^
qmm 2017-02-09 13:56:37
not really sure why i put that dollar symbol in there now :P
Koterpillar 2017-02-09 13:56:51
urlEncode False $ BS.pack $ head mystrings -- look, no brackets
qmm 2017-02-09 13:56:58
i probably don't have a great grasp on the $ operator
Koterpillar 2017-02-09 13:57:09
$ == "the rest is the last argument"
qmm 2017-02-09 14:00:10
neat way to think about it, thanks
Squarism 2017-02-09 14:24:24
Theres probebly a good reason but why do 74000 lines of java code take 17s to compile vs 6000 lines of haskell code takes 2 minutes?
lpaste_ 2017-02-09 14:30:36
qmm pasted "the error is just "parse error on input 'V.forM_' ...not a lot to go on..." at http://lpaste.net/352294
qmm 2017-02-09 14:31:15
Axman6: i went with your style the other day. it kept it all a little more condensed (thanks for responding then!)
dmwit 2017-02-09 14:32:40
qmm: Your `case` needs an `of`.
qmm 2017-02-09 14:33:49
dmwit: ty
qmm 2017-02-09 14:33:54
facepalm
qmm 2017-02-09 14:35:09
Squarism: does the java file consists of primarily 73,900 lines of elements for a list? :)
qmm 2017-02-09 14:35:32
i.e. maybe there's more going on in the haskell code?
markasoftware 2017-02-09 14:35:51
Squarism: haskell compiling is known to be very slow
geekosaur 2017-02-09 14:35:55
java code actually maps pretty directly to JVM ops
markasoftware 2017-02-09 14:36:12
and java isn't really "compiling" iirc
Squarism 2017-02-09 14:36:56
qmm, Hehe - no, not a single list. Most of the java code is quite dumb arguebly .
monochrom 2017-02-09 14:37:16
Java leaves much optimization to run time. GHC doesn't.
Squarism 2017-02-09 14:37:38
i might have "debug" mode enabled in stack though. Can i check that easily?
monochrom 2017-02-09 14:37:57
Also Haskell type inference is exponential time. Java type checking is not.
Squarism 2017-02-09 14:38:03
monochrom, can one turn of optimzation while developing?
monochrom 2017-02-09 14:38:10
Yes, -O0
markasoftware 2017-02-09 14:38:15
Squarism: just use runghc
markasoftware 2017-02-09 14:38:18
to interpret
monochrom 2017-02-09 14:38:23
But -O0 is already the default.
markasoftware 2017-02-09 14:38:24
if lower performance is ok during development
monochrom 2017-02-09 14:38:43
But maybe stack overrules it. I don't know stack. I don't know jack. That's not my trade.
Squarism 2017-02-09 14:38:54
it is
Squarism 2017-02-09 14:39:18
^ markasoftware
markasoftware 2017-02-09 14:39:33
then use it: `runghc script.hs`
Squarism 2017-02-09 14:40:25
oh.. i have -02 everywhere
Squarism 2017-02-09 14:40:51
"-O2 -threaded -with-rtsopts=-N"
monochrom 2017-02-09 14:41:10
-02 would be very fast :)
Squarism 2017-02-09 14:41:21
very optimized?
Squarism 2017-02-09 14:41:31
or fast compileing
monochrom 2017-02-09 14:41:36
"unrecognized flag" immediately :)
fresheyeball 2017-02-09 14:43:25
how can I see the rendered result of template Haskell?
monochrom 2017-02-09 14:44:17
-ddump-splices
monochrom 2017-02-09 14:44:31
add -ddump-to-file if you like
monochrom 2017-02-09 14:44:52
See GHC Users Guide section 10.26.3 "Viewing Template Haskell generated code"