mniip 2017-02-10 04:46:06
> let x = 0/0 in let (a,b) = properFraction x in x == fromIntegral a + b
lambdabot 2017-02-10 04:46:09
False
Boomerang 2017-02-10 04:46:32
> (0/0) == (0/0)
mniip 2017-02-10 04:46:33
ah well, nan == whatever
lambdabot 2017-02-10 04:46:34
False
mniip 2017-02-10 04:46:51
though fromIntegral that number is -Infinity and not Nan
mniip 2017-02-10 04:46:58
because it doesn't use encodeFloat
mniip 2017-02-10 04:47:11
fistp is faster
novakboskov 2017-02-10 04:49:15
If infinite list of integers can be constructed like this [1..] how could one construct infinite list of True values?
Boomerang 2017-02-10 04:49:29
The reason I tested "round (0/0)" in Haskell is because I saw how it behaves in Elm and it's pretty bad. Under the hood Elm uses floats to represent Ints and the abstraction leaks when doing "round (0/0)" as it returns NaN
merijn 2017-02-10 04:49:39
novakboskov: repeat True?
merijn 2017-02-10 04:49:43
> repeat True
lambdabot 2017-02-10 04:49:46
[True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,...
quchen 2017-02-10 04:49:50
Boomerang: Probably because Javascript doesn't have integers.
Tuplanolla 2017-02-10 04:50:12
> [True, True ..]
lambdabot 2017-02-10 04:50:15
[True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,...
Boomerang 2017-02-10 04:50:37
quchen That makes sense but doesn't it break the type system?
merijn 2017-02-10 04:50:52
Boomerang: Define "break the type system"?
dhalgren_ 2017-02-10 04:50:55
is there a both arrow? something that does (f *** f)?
mniip 2017-02-10 04:51:02
javascript? what's a type system
merijn 2017-02-10 04:51:16
dhalgren_: Yes, but maybe you're looking for Data.Bifunctor?
dhalgren_ 2017-02-10 04:51:30
hm!
Boomerang 2017-02-10 04:51:38
Well NaN is part of the definition of floating point numbers but not integers, right?
quchen 2017-02-10 04:51:53
> bimap (*2) (++ "hello") (10, "world")
lambdabot 2017-02-10 04:51:56
(20,"worldhello")
nshepperd_ 2017-02-10 04:51:58
Elm's type system
charleselpapi 2017-02-10 04:52:01
hello world
novakboskov 2017-02-10 04:52:40
Tuplanolla: Hm... it can parse [1..] without space between integer literal and dots whereas space is required when there is True/False literal. Right?
quchen 2017-02-10 04:53:10
Boomerang: Yes. NaN is part of IEEE floats. There is no IEEE integer because they're easy to represent.
Tuplanolla 2017-02-10 04:53:22
:t (Data.Function..) -- It's because of this, novakboskov.
lambdabot 2017-02-10 04:53:24
(b -> c) -> (a -> b) -> a -> c
quchen 2017-02-10 04:53:30
The only issues you can have with integers are overflows, that's it.
nshepperd_ 2017-02-10 04:53:39
Yes, coercing a NaN to an integer without care is surely a bug
quchen 2017-02-10 04:53:59
And maaaybe how to round divisions, but other than that I can't imagine what there is to discuss about integer numerics.
quchen 2017-02-10 04:55:03
novakboskov: [True..] is interpreted as a list containing the ».« operator from the »True« package.
quchen 2017-02-10 04:55:11
> True..
lambdabot 2017-02-10 04:55:15
quchen 2017-02-10 04:55:21
:t (Prelude..)
lambdabot 2017-02-10 04:55:23
(b -> c) -> (a -> b) -> a -> c
quchen 2017-02-10 04:55:39
:t (Prelude.+)
lambdabot 2017-02-10 04:55:41
Num a => a -> a -> a
novakboskov 2017-02-10 04:57:20
Tuplanolla: It means that double dot at the end of [1..] is double function composition?
Tuplanolla 2017-02-10 04:57:38
No, novakboskov. You already got two explanations.
quchen 2017-02-10 04:57:52
No, the last dot is function composition, the first one is how we disambiguate module components.
quchen 2017-02-10 04:57:57
Data.Functor <- dot
quchen 2017-02-10 04:58:03
Prelude.head <- dot
quchen 2017-02-10 04:58:08
Prelude.. <- dot
Tuplanolla 2017-02-10 04:58:52
> read "1." :: Double -- This interpretation might have been allowed at some point as well.
novakboskov 2017-02-10 04:58:53
Tuplanolla: Sorry but I don't understand it. You just referenced type of function composition from like
lambdabot 2017-02-10 04:58:54
*Exception: Prelude.read: no parse
novakboskov 2017-02-10 04:58:55
:t (Data.Function..)
lambdabot 2017-02-10 04:58:56
(b -> c) -> (a -> b) -> a -> c
byorgey 2017-02-10 04:59:37
novakboskov: in Prelude.. the two dots are playing different roles. The first dot separates the name of the module (Prelude) from the name of something contained in the module.
byorgey 2017-02-10 04:59:48
The second dot is the name of the (.) operator which is in the Prelude.
novakboskov 2017-02-10 05:02:56
byorgey: OK, it's clear, then Prelude.. is function composition. I've asked what is difference between [1..] and [True..] and why latter requires space between dots and True to work and Tuplanolla sad ":t (Data.Function..) -- It's because of this, novakboskov."
Tuplanolla 2017-02-10 05:03:37
The point was that `True..` and `Data.Function..` are syntactically equivalent, novakboskov.
Taneb 2017-02-10 05:04:10
novakboskov, because True begins with a capital letter, GHC goes "Aha! This looks like a module! I'm going to find (.) in the True module"
Tuplanolla 2017-02-10 05:04:43
This is not the case for `1..` since it belongs to a different name space.
novakboskov 2017-02-10 05:04:59
Taneb: Oh, right...
novakboskov 2017-02-10 05:05:54
Tuplanolla: Its clear. Thanks.
novakboskov 2017-02-10 05:06:40
BTW I didn't expected parse error, rather something like "no module" message...
Rodenbach 2017-02-10 05:07:04
Is there syntactic sugar for currying the first parameter of a binary function away. I can do (foo 10) and then the first arg will be 10. But I want the second one to be 10.
c_wraith 2017-02-10 05:07:56
Rodenbach: no, but there are functions like flip for that purpose
byorgey 2017-02-10 05:08:08
flip foo 10
Rodenbach 2017-02-10 05:08:08
Ah okay!
ClaudiusMaximus 2017-02-10 05:15:18
Rodenbach: you can also use operator sections: (`foo` 10)
markasoftware 2017-02-10 05:32:22
is Stack available on Gentoo as a package?
markasoftware 2017-02-10 05:34:47
hmm, seems not
Logio 2017-02-10 05:34:55
markasoftware: there's an ebuild in the haskell overlay
sternmull 2017-02-10 05:35:07
the atom editor causes 100% cpu load with haskell-ghc-mod when i open a big project (git-annex). It does a lot of calls to ghc and doesn't seem to finish with that. Any ideas how to fix that?
markasoftware 2017-02-10 05:36:55
sternmull: atom in a nutshell...
sternmull 2017-02-10 05:38:33
markasoftware: i don't know if its a problem with atom or with ghc-mod, maybe i would have the same experience when using emacs
lambdamu 2017-02-10 05:39:57
Hi, I'm looking to hash STRef, is it fair to asume that they are pointers internally and can be casted to 64-bit (or 32-bit, depending on architecture) words and that they are not moved by the garbage collection?
lambdamu 2017-02-10 05:41:05
I was also wondering if it is were possible to have some kind of critical region where garbage can't strike?
lambdamu 2017-02-10 05:41:46
So that it were even possible to compare plain values by reference
ClaudiusMaximus 2017-02-10 05:42:04
StablePtr can be used to work around GC moving things, afaik (not used it myself)
lambdamu 2017-02-10 05:42:49
Hm yes I know, if I had pure values i would use them probably, but here I already have references
phadej 2017-02-10 05:43:09
lambdamu: Eq on STRef is pointer equality
phadej 2017-02-10 05:43:21
lambdamu: and http://hackage.haskell.org/package/base-4.9.1.0/docs/System-Mem.html could be used to run GC before critical section
lambdamu 2017-02-10 05:44:21
phadej: On the critical section: That would make it unlikely to run immediately again, but not impossible i guess?
phadej 2017-02-10 05:44:47
lambdamu: not impossible.
phadej 2017-02-10 05:45:08
I have no first-hand experience, but I'd expect it to run highly unluckily