merijn 2017-02-08 03:46:13
> (1/0)
lambdabot 2017-02-08 03:46:15
Infinity
merijn 2017-02-08 03:46:18
> (1/0) + 2
lambdabot 2017-02-08 03:46:21
Infinity
merijn 2017-02-08 03:46:25
> (-1/0) + 2
lambdabot 2017-02-08 03:46:28
-Infinity
chelfi 2017-02-08 03:49:03
> (-1/0) + (1/0)
lambdabot 2017-02-08 03:49:05
NaN
Tuplanolla 2017-02-08 03:49:45
> let x = 1 / 0 + x in x
lambdabot 2017-02-08 03:49:48
error:
lambdabot 2017-02-08 03:49:48
• No instance for (Num Fatality) arising from the literal '1'
lambdabot 2017-02-08 03:49:48
• In the first argument of '(/)', namely '1'
merijn 2017-02-08 03:50:00
wut
Tuplanolla 2017-02-08 03:50:09
> let x = (1 / 0) + x in x
lambdabot 2017-02-08 03:50:11
Fatality
merijn 2017-02-08 03:50:40
What's the minimal lines of code to instance Functor + Applicative + Monad?
merijn 2017-02-08 03:51:09
For 7.10 and later
Tuplanolla 2017-02-08 03:51:15
I guess three for `fmap`, `<*>` and `>>=`, merijn.
merijn 2017-02-08 03:51:45
<*> is annoying to define and I think you can do that with "ap"
quchen 2017-02-08 03:53:00
fmap = liftM, pure = …, <*> = ap, >>= = …
quchen 2017-02-08 03:53:09
merijn: ^
the_other_cat 2017-02-08 03:53:38
Hello, sorry for the newbie question but how can I list only packages which are installed in a cabal sandbox?
merijn 2017-02-08 03:53:40
And rely on return defaulting to pure?
merijn 2017-02-08 03:53:47
the_other_cat: cabal sandbox hc-pkg list
Welkin 2017-02-08 03:53:49
the_other_cat: cabal freeze
Tuplanolla 2017-02-08 03:53:51
Right, I forgot `pure` there.
Welkin 2017-02-08 03:53:52
oh
quchen 2017-02-08 03:54:07
merijn: I'm not sure 7.10 already had return as a non-required definition
quchen 2017-02-08 03:54:16
Maybe you need to add return = pure
merijn 2017-02-08 03:54:19
quchen: We'll see
Tuplanolla 2017-02-08 03:54:41
Yet the answer is still three if you use `DeriveFunctor`, merijn.
the_other_cat 2017-02-08 03:56:49
merijn: I tried that, yet it lists xmonad-0.11 although I just did cabal sandbox init in a fresh directory?!
merijn 2017-02-08 04:03:33
If I have a type "data Foo a" I can't have a different instance for "Enum (Foo a)" depending on whether 'a' is Bounded, right?
mniip 2017-02-08 04:04:37
no
merijn 2017-02-08 04:04:49
Rats...
mniip 2017-02-08 04:04:57
the instance dictionary for Enum (Foo a) will be pi-quantified then
noan 2017-02-08 04:05:02
Today I switched my keyboard layout to Danish so I could write an Ø easier to represent emptyset. To hell with being able to type properly otherwise!. That is all. Worth it.
mniip 2017-02-08 04:05:15
∅
mniip 2017-02-08 04:05:19
U+2205
noan 2017-02-08 04:05:19
ø
noan 2017-02-08 04:05:30
five keys... or one?
noan 2017-02-08 04:05:32
:D
Tuplanolla 2017-02-08 04:06:10
It may look the same, but it's a completely different character, noan.
noan 2017-02-08 04:06:18
Tuplanolla, I'm very aware.
Tuplanolla 2017-02-08 04:06:36
This should give you an unpleasant feeling like leaving open a parenthesis.
noan 2017-02-08 04:07:22
Jokes on you, I am not a parser!
merijn 2017-02-08 04:07:29
mniip: Sadly that makes the instance I have to write impossible :\
Tuplanolla 2017-02-08 04:08:20
You can only redeem yourself by pronouncing it like a Dane would, noan.
mettekou 2017-02-08 04:08:30
Is it a bad practice to create Read and Show instances which read and show pattern synonyms, rather than constructors?
noan 2017-02-08 04:08:34
LÆS MERE
noan 2017-02-08 04:08:59
Tuplanolla, I speak swedish. Speaking Danish is a very fun joke between my partner and I. And the rest of this country.
noan 2017-02-08 04:09:07
f.eks
mettekou 2017-02-08 04:10:22
noan: I thought Scandinavian (Danish, Swedish and Norwegian, not Finnish of course, because it's not Germanic) people just spoke their language to one another because the differences are small enough to be worked out at run-time? 😜
noan 2017-02-08 04:11:13
mettekou, sort of. English gets used with the danes a lot, because we have trouble understanding them. But yeah, I'm an immigrant here and I don't even usually notice if someone is speaking Norwegian. I think they just speak funny.
noan 2017-02-08 04:11:21
"What a weird accent"
Tuplanolla 2017-02-08 04:12:38
People at the university sometimes speak English to each other even if they share a common language, because nobody knows how to translate technical terms, mettekou.
noan 2017-02-08 04:13:40
there's also a lot of english loan words in Swedish and other nordic languages, yeah. I guarantee a Monad is still a Monad.
mettekou 2017-02-08 04:14:55
noan: Is that a loan word from English though? I thought it came from Latin.
mettekou 2017-02-08 04:16:41
noan: Just looked it up, it comes from the ancient Greek for unity.
noan 2017-02-08 04:16:50
mettekou, probably not in this case. I suppose I more realistically meant "foreign words for technical things". Juice is Juice lolXD
Tuplanolla 2017-02-08 04:17:26
It's a made-up mix of several words, mettekou, most likely derived monoid and triad.
merijn 2017-02-08 04:17:35
> (0/0)
lambdabot 2017-02-08 04:17:39
NaN
merijn 2017-02-08 04:17:59
> toRational ((0/0) :: Double)
lambdabot 2017-02-08 04:18:05
(-26965397022934738615939577861835371004269654684134598591014512173659901370...
Tuplanolla 2017-02-08 04:18:08
See Saunders Mac Lane's book, page 138.
merijn 2017-02-08 04:18:09
hmmm
merijn 2017-02-08 04:18:14
That seems...odd?
merijn 2017-02-08 04:18:38
How can Real/Integral/RealFrac/RealFloat ever be implemented for types that have "NaN" values?
makalu 2017-02-08 04:18:42
this is a subset of my stack.yaml file http://lpaste.net/4260262852146757632 when I run stack build it complains that text-1.2.0.6 requires integer-simple. I don't know where this dependency comes from in the first place since text only requires integer-simple when you specify a flag. Even so, the fact that I added integer-simple does not help. How can I build text like this? I actually want...
makalu 2017-02-08 04:18:43
...to later replace the URLs with self-hosted package URLs.
merijn 2017-02-08 04:18:56
> toInteger ((0/0) :: Double)
lambdabot 2017-02-08 04:18:58
error:
lambdabot 2017-02-08 04:18:58
• No instance for (Integral Double)
lambdabot 2017-02-08 04:18:58
arising from a use of 'toInteger'
noan 2017-02-08 04:19:08
merijn, through lies. Thanks IEWhatever specifications!
merijn 2017-02-08 04:19:10
oh... that one's obvious, I suppose
merijn 2017-02-08 04:19:20
noan: Yes, but which lies am I supposed to use?
merijn 2017-02-08 04:19:38
I have a type with NaN like values and I'm unsure what to return
merijn 2017-02-08 04:19:50
> toRational ((1/0) :: Double)
noan 2017-02-08 04:19:53
merijn, https://openclipart.org/download/243784/Mentally-Deranged-Smiley-Face-Silhouette.svg
lambdabot 2017-02-08 04:19:53
1797693134862315907729305190789024733617976978942306572734300811577326758055...
mettekou 2017-02-08 04:20:17
Tuplanolla: Page 138 doesn't discuss the etymology of the word though, it just laments about the overuse of triple for the construction.
merijn 2017-02-08 04:21:10
heh...
byorgey 2017-02-08 04:21:27
mettekou: see http://english.stackexchange.com/questions/30654/where-does-the-term-monad-come-from
merijn 2017-02-08 04:21:36
Double is an instance of RealFloat without being one of RealFrac which is a superclass? I'm confused
merijn 2017-02-08 04:22:55
Anyone?
glguy 2017-02-08 04:23:21
merijn: Double is an instance of RealFrac
merijn 2017-02-08 04:23:37
glguy: Where is the instance? It's not in the haddocks
glguy 2017-02-08 04:23:51
merijn: Try typing ":i Double" in GHCi
mettekou 2017-02-08 04:23:59
byorgey: I find it hard to believe that there is no link between the word in the context of category theory and its earlier use in the context of philosophy.
glguy 2017-02-08 04:24:03
It'll show you the instances and where they're defined
mettekou 2017-02-08 04:24:17
Although it's not impossible that they're unrelated, I guess.
byorgey 2017-02-08 04:24:35
mettekou: well, I find it easy to believe.
mettekou 2017-02-08 04:24:37
Or rather that their etymology is, because their meaning is obviously unrelated.
merijn 2017-02-08 04:24:41
glguy: GHC.Float, but that module has no haddocks either...
byorgey 2017-02-08 04:25:32
mettekou: it seems pretty clear from the available evidence that there is no link.
merijn 2017-02-08 04:27:03
hmmm, maybe I should just basically use Double's implementation of toRational for my NaN value...
mnoonan 2017-02-08 04:27:25
there is no link to the "monad" in "monadic second-order logic" either, right? That's always annoyed me..
merijn 2017-02-08 04:27:27
Then I just have to invent something for Integral
halogena1dtoast 2017-02-08 04:39:09
I successfully finished and released my first yesod app online. Thanks #haskell for all the help.