Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 437 438 439 440 441 442 443 444 445 446 447 .. 5022
502,152 events total
2020-10-05 19:02:58 <ghoulguy> 'MyLeft 50' is a value that has the type "MyEither Integer something"
2020-10-05 19:03:03 conal joins (~conal@64.71.133.70)
2020-10-05 19:03:03 × conal quits (~conal@64.71.133.70) (Client Quit)
2020-10-05 19:03:06 <monochrom> sep2: I don't understand the question.
2020-10-05 19:03:19 berberman joins (~berberman@2408:8207:2560:ee60:584e:a9ff:fe9b:d3fe)
2020-10-05 19:03:26 conal joins (~conal@64.71.133.70)
2020-10-05 19:03:31 <zoom84> ok, so using a type constructor yields something haskell terms a value?
2020-10-05 19:03:46 <ski> zoom84 : in terms of Java terminology, yes, you could say it's an "instance" of the type `MyEither Int Double'. but Haskell doesn't use the term "instance" in this sense, uses it for something different instead
2020-10-05 19:04:03 <ski> zoom84 : a type constructor is different from a data constructor
2020-10-05 19:04:05 <frdg> how could I go about creating a type-class for Set? In the same way that fmap is defined for the Functor class, can I a define a predicate, isSet, that a individual Set (just a list to haskell) must hold for? Is what I am describing different from a type class?
2020-10-05 19:04:24 <hc> zoom84: a type constructor yields a concrete type
2020-10-05 19:04:24 <zoom84> ah, ok. i remember that ski.
2020-10-05 19:04:31 conal_ joins (~conal@64.71.133.70)
2020-10-05 19:05:01 <zoom84> so MyLeft and MyRight are called data constructors
2020-10-05 19:05:03 <ski> zoom84 : `MyEither',`Int',`Bool',`Double',`IO',`(->)' are type constructors. `MyLeft',`MyRight',`False',`True' are data constructors
2020-10-05 19:05:06 <ski> yes
2020-10-05 19:05:07 <frdg> isSet :: [a] -> Bool
2020-10-05 19:05:15 <sep2> @monochrom How do I go about accepting an empty finite state machine ? Q = {0}•s=0•F=∅• δ(0,a)=0foralla∈Σ.
2020-10-05 19:05:16 <lambdabot> Unknown command, try @list
2020-10-05 19:05:28 <sep2> That was badly formatted excuse me
2020-10-05 19:05:29 <dolio> Either doesn't yield a concrete type after one application.
2020-10-05 19:05:41 <ski> zoom84 : type constructors are types. but not necessarily vice versa. `MyEither Int [Bool]' is a type, but not a type constructor
2020-10-05 19:05:51 <monochrom> Accept an empty machine? Accept an empty language?
2020-10-05 19:06:35 <zoom84> your example is not a type constructor because it's fully applied, correct?
2020-10-05 19:06:58 <ski> zoom84 : some type constructors are concrete (e.g. `Bool',`Int'), some aren't (e.g. `MyEither',`IO',`(->)',`Maybe'). you could also say that the latter are parameterized (/ are type functions), and the former are not parameterized (are not type functions)
2020-10-05 19:07:03 Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net)
2020-10-05 19:07:30 <monochrom> Are you OK with simply emptyFSM = ([0], 0, [], \s c -> 0) ?
2020-10-05 19:07:32 <zoom84> for example, (MyEither a) is a type constructor but (MyEither a b) is a type (and a concrete one). is that right?
2020-10-05 19:07:39 × chele quits (~chele@ip5b416ea2.dynamic.kabel-deutschland.de) (Remote host closed the connection)
2020-10-05 19:07:51 <zoom84> the former being a constructor because it's not fully applied (ie, missing "b")
2020-10-05 19:07:54 knupfer joins (~Thunderbi@200116b82cef83007c6d07fffe625a30.dip.versatel-1u1.de)
2020-10-05 19:07:55 × knupfer quits (~Thunderbi@200116b82cef83007c6d07fffe625a30.dip.versatel-1u1.de) (Client Quit)
2020-10-05 19:07:55 × conal quits (~conal@64.71.133.70) (Ping timeout: 240 seconds)
2020-10-05 19:08:03 <ski> zoom84 : `MyEither' is parameterized, is a type function, since you can "apply" it to a type (not a value). e.g. applying it to `Int' gives `MyEither Int' .. which is also not concrete, is still a type function, still accepts a further parameter
2020-10-05 19:08:07 knupfer joins (~Thunderbi@87.123.206.236)
2020-10-05 19:08:18 × conal_ quits (~conal@64.71.133.70) (Client Quit)
2020-10-05 19:08:29 alx741 joins (~alx741@186.178.110.22)
2020-10-05 19:08:45 × alx741 quits (~alx741@186.178.110.22) (Client Quit)
2020-10-05 19:09:01 <ski> zoom84 : applying `MyEither Int' to e.g. `[Bool]', you get `(MyEither Int) [Bool]', which we can write simpler just as `MyEither Int [Bool]', and this is a concrete type (no further parameters accepted), and so we can talk about values of this type `MyEither Int [Bool]'
2020-10-05 19:09:05 Falkeo joins (5631fd8b@ip-86-49-253-139.net.upcbroadband.cz)
2020-10-05 19:09:15 <ski> (it doesn't make sense to talk about values of a non-concrete type)
2020-10-05 19:09:36 <zoom84> got it. to fully nail down the correct terminology, both (Either a) and (Either Int) are type constructors since they're not fully applied. the former uses a parameterized var but otherwise they're called the same thing?
2020-10-05 19:10:16 <ski> zoom84 : "your example is not a type constructor because it's fully applied, correct?" -- no. `MyEither Int [Bool]' is fully applied. type constructor is a separate issue from being concrete (some type constructors are concrete, some aren't. some concrete types are type constructors, some aren't)
2020-10-05 19:10:30 <ski> zoom84 : no
2020-10-05 19:10:36 avdb joins (~avdb@ip-213-49-124-37.dsl.scarlet.be)
2020-10-05 19:10:47 <zoom84> hmm...
2020-10-05 19:10:53 <zoom84> if I have Either a b
2020-10-05 19:10:53 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-10-05 19:10:58 <sep2> @monochrom that's what I had originally thought but I would get error: Data constructor not in scope: Undefined :: FSM Int
2020-10-05 19:10:59 <lambdabot> Unknown command, try @list
2020-10-05 19:11:04 conal joins (~conal@64.71.133.70)
2020-10-05 19:11:14 <zoom84> and use (Either a) in a functor, I thought that (Either a) implicitly creates a type constructor by dint of not being fully applied
2020-10-05 19:11:35 <monochrom> But I didn't wrote "Undefined" anywhere.
2020-10-05 19:11:35 × knupfer quits (~Thunderbi@87.123.206.236) (Read error: Connection reset by peer)
2020-10-05 19:11:42 knupfer joins (~Thunderbi@200116b82cef8300610dc462ddae2e63.dip.versatel-1u1.de)
2020-10-05 19:11:54 <ski> a type constructor is a "single atomic name" for a type (not including type variables). like `MyEither',`Int',`Maybe',`IO',`(->)'. but not including compound/complicated types like `Maybe Int',`(->) Int Bool',`MyEither Int',`MyEither Int [Bool]'
2020-10-05 19:11:56 <monochrom> WHO WROTE THAT?!
2020-10-05 19:12:51 <zoom84> "Well well, what did we do here? You can see how we made Either a an instance instead of just Either. That's because Either a is a type constructor that takes one parameter, whereas Either takes two. "
2020-10-05 19:12:59 <zoom84> http://learnyouahaskell.com/making-our-own-types-and-typeclasses#the-functor-typeclass
2020-10-05 19:13:03 × AlterEgo- quits (~ladew@124-198-158-163.dynamic.caiway.nl) (Quit: Leaving)
2020-10-05 19:13:06 <sep2> It was looking at the next line after this one, where it takes in 'a' from sigma which is undefined for now @monochrom
2020-10-05 19:13:31 <monochrom> You need to paste full code. I am not telepathic.
2020-10-05 19:13:48 <maerwald> not even a little bit?
2020-10-05 19:13:48 <ski> just like a data constructor is a "single atomic name" for an alternative of a data type. like `MyLeft',`MyRight',`Nothing',`Just',`False',`True'. but not including compound/complicated value expressions like `MyLeft 10',`MyRight [False,True,False]',`Just 42'
2020-10-05 19:13:55 <monochrom> I am dumb.
2020-10-05 19:14:15 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 244 seconds)
2020-10-05 19:14:18 <monochrom> I know that most of you are telepathic.
2020-10-05 19:14:20 <zoom84> ski, so is the text I pasted from learnyouhaskell incorrect then?
2020-10-05 19:14:28 hackage uniqueness-periods-vector-examples 0.8.0.1 - Usage examples for the uniqueness-periods-vector series of packages https://hackage.haskell.org/package/uniqueness-periods-vector-examples-0.8.0.1 (OleksandrZhabenko)
2020-10-05 19:14:34 ChanServ sets mode +o dolio
2020-10-05 19:14:34 dolio sets mode -o monochrom
2020-10-05 19:14:41 dolio sets mode -o dolio
2020-10-05 19:14:43 alx741 joins (~alx741@186.178.110.22)
2020-10-05 19:15:13 <ski> zoom84 : there are two different schools of terminology. one calls parameterized types / types functions, "type constructors" (but then there's no good name for the "single atomic names of types", reserves the name "type" for what i've called "concrete type"
2020-10-05 19:15:24 geekosaur joins (42d52102@66.213.33.2)
2020-10-05 19:15:32 <sep2> https://dpaste.org/fFjT
2020-10-05 19:16:06 <monochrom> OK, so use lowercase "undefined"?
2020-10-05 19:16:09 <zoom84> ski, that's unfortunate
2020-10-05 19:16:10 <ski> in the other school, `Functor' is not a type class, but a "constructor class" (since `f' in `Functor f' is not a "type", but a "type constructor")
2020-10-05 19:16:13 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-05 19:16:16 shaman_king joins (b94186ae@185.65.134.174)
2020-10-05 19:16:23 <shaman_king> i think haskell sucks ass.
2020-10-05 19:16:28 <ski> however, i haven't seen people use the term "constructor class" in a long time
2020-10-05 19:16:29 ChanServ sets mode +o monochrom
2020-10-05 19:16:31 shaman_king parts (b94186ae@185.65.134.174) ()
2020-10-05 19:16:43 monochrom sets mode -o monochrom
2020-10-05 19:16:56 <ski> and i personally think the alternative terminology that i've been using is better
2020-10-05 19:17:13 <dolio> Type functions definitely don't need another name.
2020-10-05 19:17:22 <zoom84> btw, haven't thanked you yet for all the time you spent walking me through this. so before I continue, a huge thanks
2020-10-05 19:17:28 <ski> (some people disagree about the "concrete" term. but otherwise, i think mostly people use "type constructor" and "type" in the sense i've been using them)
2020-10-05 19:17:30 <dolio> With a distinct meaning from the value-level version to confuse things.
2020-10-05 19:18:08 <zoom84> so what is the output of a data constructor called? Just data? ie, "MyLeft 50"
2020-10-05 19:18:25 <ski> you could call it a value of a data type
2020-10-05 19:18:25 <zoom84> z = MyLeft 50. is z just considered "data"?
2020-10-05 19:19:00 <ski> usually people say "value" unless they have a more specific term in mind (like "integer","string","list (of ...)",&c.)
2020-10-05 19:19:02 <zoom84> calling it a value is deeply unsatisfying :)
2020-10-05 19:19:17 st8less joins (~st8less@2603:a060:11fd:0:101c:4882:6a23:1c57)
2020-10-05 19:19:18 <ski> why ?
2020-10-05 19:19:35 <ski> you could call `z' a datum (singular of "data"), if you want to
2020-10-05 19:20:00 machinedgod joins (~machinedg@142.169.78.126)

All times are in UTC.