Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 03:29
    som-snytt commented #9666
  • 03:25
    som-snytt commented #9651
  • 03:21
    xuwei-k labeled #12260
  • 02:01
    magnolia-k synchronize #9666
  • 01:45
    magnolia-k commented #12260
  • 01:45
    magnolia-k closed #9651
  • 01:45
    magnolia-k commented #9651
  • 01:43
    scala-jenkins milestoned #9666
  • 01:43
    magnolia-k opened #9666
  • 01:42
    magnolia-k commented #9660
  • Jun 12 22:01
    alvinj commented #2073
  • Jun 12 22:01
    alvinj commented #2062
  • Jun 12 19:45
    Ichoran commented #12400
  • Jun 12 19:22
    alvinj commented #2076
  • Jun 12 19:18
    alvinj commented #2076
  • Jun 12 18:47
    johnynek commented #12400
  • Jun 12 18:47
    johnynek commented #12400
  • Jun 12 18:22
    Ichoran commented #12400
  • Jun 12 17:23
    smarter labeled #12413
  • Jun 12 17:23
    smarter labeled #12413
Fabio Labella
@SystemFw
in Haskell is a bit clearer because Just can not be a type (I'm ignoring DataKinds ofc, but even in that case it's not the same)
Jose C
@jmcardon
:(
ok
thanks @martijnhoekstra
Fabio Labella
@SystemFw
yeah, Just and Nothing aren't types in Haskell at all, just constructors whose result has type Maybe a
Jose C
@jmcardon
Benching stuff, it's pretty nutty that .asInstanceOf casts can be equally expensive or more than creating a new object in the heap, as far as runtime is concerned
trepidacious
@trepidacious
@SystemFw And Nothing isn't a type constructor because it has no type parameter, whereas Const is, even though the type parameter does nothing?
Fabio Labella
@SystemFw
no
that's not the reason
data Maybe a = Just a | Nothing
the stuff to the right of = is data constructors, not types
Jose C
@jmcardon
yeah
you can't have stuff return Just I think
only Maybe
Fabio Labella
@SystemFw
in Scala you have a hierarchy of types/classes
in Haskell you have a type with variants
Just and Nothing are two things
trepidacious
@trepidacious
@SystemFw Ah ok, that makes sense. Even in Scala though None wouldn't be a type constructor because it is just a type?
@SystemFw Whereas Some actually is?
Jose C
@jmcardon
yeah
you can see it in the signature
Fabio Labella
@SystemFw
right, the important distinction here is not between type and type constructor
that doesn't matter
Jose C
@jmcardon
object None extends Option[Nothing]
Fabio Labella
@SystemFw
it's between type constructor and data constructor
the fact that Nothing/None have no arguments is not the point I'm making
let me put it this way
trepidacious
@trepidacious
@SystemFw I get that Nothing is different to a type or type constructor (at least approximately) yup.
Fabio Labella
@SystemFw
same for Just
yeah ok
Jose C
@jmcardon
@trepidacious what do you find weird about grasping re: type constructors?
trepidacious
@trepidacious
@SystemFw Yes. But it's still the case that to have a functor you need a type constructor rather than a type? I get that Just and Nothing fail even BEFORE that by not being a type OR a type constructor :)
Fabio Labella
@SystemFw
(btw, the distinction between type and type constructor is not really useful imho except in conversational talking, they're all types afterall, and we have kinds to talk about them precisely)
a Functor needs to be over a type of kind * -> *
that's what you need
trepidacious
@trepidacious
@SystemFw Is * -> * not the same as a type constructor? I thought they were just different terms for the same thing?
Fabio Labella
@SystemFw
yeah, but type constructor is not as precise
think Either
trepidacious
@trepidacious
@jmcardon I think I'm ok on that, we just ended up talking about two things at once, I didn't know about type constructors versus data constructors though
Fabio Labella
@SystemFw
that's also a type constructor
but can't be a functor
Either a can
Jose C
@jmcardon
b-b-b-b-bifunctor!
trepidacious
@trepidacious
Ah because it has two type paramters
Fabio Labella
@SystemFw
so I'd recommend just talking in terms of kinds
it's way more precise
trepidacious
@trepidacious
Is that * -> * -> * then?
Fabio Labella
@SystemFw
yeah
and in haskell types and "type constructors" have the same representation anyway
trepidacious
@trepidacious
How do I pronounce *->*?