<    June 2018     >
Su Mo Tu We Th Fr Sa  
                1  2  
 3  4  5  6  7  8  9  
10 11 12 13 14 15 16  
17 18 19 20 21 _2_2 23  
24 25 26 27 28 29 30
11:35 irclogger_com joined
11:35 Topic for
11:35 davs joined
11:46 thc202 joined
11:49 louispan joined
11:55 <cppxor2arr> dminuoso: thanks
12:03 louispan joined
12:11 MarcelineVQ joined
12:24 sigmundv joined
12:32 AndreasK joined
12:33 Linter joined
12:38 progfun joined
12:40 louispan joined
12:44 slomo joined
12:54 nickolay_ joined
13:16 progfun joined
13:16 matsurago joined
13:19 emilypi joined
13:20 aarvar joined
13:38 Linter joined
13:58 progfun joined
13:58 progfun_ joined
14:11 nD5Xjz joined
14:25 nD5Xjz joined
14:27 netheranthem joined
14:28 TCZ joined
14:30 progfun joined
14:31 progfun_ joined
14:32 progfun__ joined
14:33 progfu___ joined
14:36 progf____ joined
14:37 progfun_ joined
14:38 progfun__ joined
14:39 progfun__ joined
14:40 progfun joined
14:58 thoradam joined
15:03 sulan_ joined
15:14 Gurkenglas joined
15:37 sigmundv joined
15:46 xpycm joined
15:49 nicht joined
15:49 nicht_ joined
16:02 davs_ joined
16:04 bbrodriguez joined
16:07 pfurla_ joined
16:07 Linter joined
16:13 zfnmxt joined
16:13 davs joined
16:20 emilypi joined
16:28 louispan joined
16:28 opto joined
16:34 ToffeeYogurtPots joined
16:39 Big_G joined
16:41 scampbell joined
16:42 opto left
16:44 ToffeeYogurtPots joined
16:49 davs_ joined
16:52 howdoi joined
17:00 acarrico joined
17:07 davs joined
17:08 kueller_ joined
17:09 <kueller_> Could anyone explain why `i :: a; i = 1` fails to compile?
17:09 <kueller_> I understand that the compiler can figure out a more concrete type than the one I'm providing, but I don't understand why that would cause it to fail *for a return type*
17:10 <kueller_> -concrete+precise
17:11 barcabuona joined
17:13 <monochrom> The point is not whether it's a return type. That's irrelevant.
17:14 <monochrom> The issue is that the user, not the implementer, chooses what they want "a" to be.
17:15 <monochrom> The implementer promises "i :: a". This means the user gets to say: Can't I use it where I need a Bool? Yes!
17:15 <monochrom> The implementer goes on the break that promise by saying "i = 1".
17:16 <monochrom> My freedom is your slavery.
17:16 <kueller_> ah. When you put it that way, it makes a lot of sense. Thank you.
17:16 <monochrom> Yes, this is what's wrong with the popular "any" narrative ("a can be any [sic] type")
17:17 <monochrom> The contention has never been on whether it's "any". The contention is which side has the right to it.
17:18 <kueller_> in my case, it's more to do with all that OOP baggage I'm trying to get rid of. I can't help but instictively think of unconstrained a as a universal supertype
17:19 sigmundv joined
17:29 davs_ joined
17:49 drbrule joined
17:50 emilypi joined
17:57 albertus1 joined
18:00 nschoe joined
18:16 kmelva joined
18:27 emilypi joined
18:32 dopplergange joined
18:37 Linter joined
18:42 Linter joined
18:47 emilypi joined
18:58 rembo10 joined
19:10 Linter joined
19:14 vurtz joined
19:17 conal_ joined
19:20 nschoe joined
19:29 obi_jan_kenobi_ joined
19:52 conal_ joined
19:58 <Linter> Oh snap! The Haskell Book says on page 35 of 1.0RC2, "There is a value in Prelude called pi." But looking at the documentation for pi (http://hackage.haskell.org/package/base-, it's listed as a method where "pi :: a". So I guess pi is a function disguised as a value!? 😀
20:02 <qu1j0t3> Linter: it doesn't take any arguments, so at most a degenerate function :)
20:04 <hexagoxel> it depends a bit if you view "passing the Dict" as an argument..
20:04 <Linter> qu1j0t3: Oh wow, I'm gonna look up what a degenerate function is....
20:05 <hexagoxel> and especially if you are not polymorphic, then this can be resolved at compile-time.
20:05 <Linter> hexagoxel: I'm very new to Haskell. What does it mean to "pass the Dict" when typing "pi" into the GHCi and having it display its (approximate) value?
20:06 <hexagoxel> Linter: pi is a member of a typeclass. so its type really is "Floating a => a"
20:08 <hexagoxel> which you can view like a function "Dict (Floating a) -> a" (although it does not need to be implemented that way)
20:09 fabsn joined
20:09 carlomagno joined
20:11 <Linter> Oh wow, hmm.... I haven't learned type signatures yet, so I have a lot to learn still. 😀 But thank you! I guess I will think of pi for now as a value that could be thought of in some ways as a function? 🤷‍♂️
20:13 <hexagoxel> Linter: in ghci there is also defaulting at work, which chooses a specific Floating instance and uses that to show/print the value.
20:13 <hexagoxel> probably Double
20:14 <Linter> hexagoxel: Oh wow, hmm.... It looks like there is still a lot for me to learn to be able to understand this entity that is called "pi" 😀
20:17 <monochrom> pi isn't harder than 0. 0's type is "Num a => a". It is polymorphic.
20:17 <monochrom> And they are both just one step up from the empty list []. Its type is "[a]", which is polymorphic.
20:18 <monochrom> All you need to do is to open your mind to the possibility of polymorphic values. Everything does not have to be a function.
20:19 <Linter> monochrom: Oh wow, that is pretty amazing. What does a polymorphic value mean? Does it mean the same as in OOP languages such as C#?
20:20 <hexagoxel> for any type that has a Floating instance, there is a value `pi` with that type.
20:20 <hexagoxel> > pi :: Float
20:20 <lambdabot> 3.1415927
20:20 <hexagoxel> > pi :: Double
20:20 <lambdabot> 3.141592653589793
20:23 <Linter> hexagoxel: So I guess there are different types of `pi`. There is a value of `pi` that has type Float, and there is a value of `pi` that has type Double?
20:26 <hexagoxel> yes
20:27 <hexagoxel> you give the compiler (prove of) an instance for the type, and it gives you the value.
20:27 <hexagoxel> that prove can come from outside, e.g.
20:27 mud joined
20:28 <hexagoxel> :t let multipleOfPi x = pi * x in multipleOfPi
20:28 <lambdabot> Floating a => a -> a
20:28 Arcaelyx joined
20:30 <hexagoxel> you don't know which instance of `pi` it is, so your function has a constraint that is "prove of the instance of a" that the user of `multipleOfPi` provides when calling it
20:32 <Linter> hexagoxel: Oh okay, hmm....
20:33 <hexagoxel> but when we write (pi :: Float) we don't need to add `Floating Float => Float` in its type, because we already know the instance "Floating Float" exists.
20:42 <hexagoxel> Linter: further reading at https://wiki.haskell.org/Haskell_inside/OOP_vs_type_classes#Type_classes_is_a_sort_of_templates.2C_not_classes
20:43 <monochrom> I haven't seen an OO language that has polymorphic values apart from polymorphic functions.
20:45 <monochrom> And in that sentence "polymorphic" is already very broad-sense.
21:11 fabsn_ joined
21:29 fabsn joined
21:32 patbecich joined
21:37 hamishmack joined
21:39 Linter joined
21:39 emilypi joined
21:41 thoradam joined
21:44 tvN joined
21:45 fabsn joined
21:48 Linter joined
21:52 hiratara joined
21:55 Cthalupa joined
22:03 barcabuona joined
22:14 carlomagno joined
22:16 matsurago joined
22:17 pfurla joined
22:26 lumm joined
22:27 pfurla__ joined
22:28 Linter joined
22:32 hiratara joined
22:52 ego joined
22:56 tvN left
22:59 acarrico joined
23:00 harfangk joined
23:02 bbrodriguez joined
23:08 harfangk joined
23:08 Durbley joined
23:15 _ikke_ joined
23:23 acarrico joined
23:43 _ikke_ joined
23:51 bbrodriguez joined
23:59 kroomey joined