Jump to content


Photo

My brain hurts

science

  • Please log in to reply
13 replies to this topic

#1 codemonkey

codemonkey

    Ass. Comptroller of Ferthdays

  • Members
  • PipPipPipPipPip
  • 18916 posts
  • LocationMy suburban paradise

Posted 24 May 2016 - 04:03 PM

So now that I'm using Scala, I keep running into functional programming concepts such as "Type-Level programming." Seems like the weirdest shit in scala comes from Haskell, so I've gone ahead and installed GHC....

 

:mellow:

 

My conclusion is that the people who dig this type of stuff aren't suitable for any job outside academia. And I thought Mac people were weird....


  • 0

#2 codemonkey

codemonkey

    Ass. Comptroller of Ferthdays

  • Members
  • PipPipPipPipPip
  • 18916 posts
  • LocationMy suburban paradise

Posted 24 May 2016 - 04:27 PM

Exhibit B

ghci> max 5 6
6
ghci> let myList = [1..10]
ghci> maximum myList
10
ghci> maximum 5 6
 
<interactive>:28:1:
    Non type-variable argument in the constraint: Ord (a -> t)
    (Use FlexibleContexts to permit this)
    When checking that ‘it’ has the inferred type
      it :: forall (t :: * -> *) a t1.
            (Num a, Num (t (a -> t1)), Ord (a -> t1), Foldable t) =>
            t1
ghci> 

:blink:


  • 0

#3 TheSmasherDon

TheSmasherDon

    Perro Grande

  • Patron
  • PipPipPipPip
  • 5015 posts
  • LocationSimi Valley California

Posted 24 May 2016 - 05:03 PM

My brain hurts too.

From dealing with stupid people.

Feck Georgia.

:frank:
  • 0

#4 humdum

humdum

    Comptroller of Chili and Other Fine Bean-Free Foods

  • Moderators
  • PipPipPipPip
  • 8770 posts
  • LocationThe Republic of Texas

Posted 24 May 2016 - 05:06 PM

My brain hurts too.

From dealing with stupid people.

Feck Georgia.

:frank:


lol!

#5 japh

japh

    Winner!

  • Members
  • PipPipPipPipPip
  • 10422 posts
  • LocationOregon

Posted 25 May 2016 - 07:59 AM

Exhibit B

ghci> max 5 6
6
ghci> let myList = [1..10]
ghci> maximum myList
10
ghci> maximum 5 6
 
<interactive>:28:1:
    Non type-variable argument in the constraint: Ord (a -> t)
    (Use FlexibleContexts to permit this)
    When checking that ‘it’ has the inferred type
      it :: forall (t :: * -> *) a t1.
            (Num a, Num (t (a -> t1)), Ord (a -> t1), Foldable t) =>
            t1
ghci> 

:blink:

So.... max and maximum are different functions that don't work on the same types?  Weird. 


  • 0

#6 codemonkey

codemonkey

    Ass. Comptroller of Ferthdays

  • Members
  • PipPipPipPipPip
  • 18916 posts
  • LocationMy suburban paradise

Posted 25 May 2016 - 08:19 AM

what blows my mind is how cryptic and useless the error message is. What ever happened to expecting A found B?
  • 0

#7 SchwanzBrewer

SchwanzBrewer

    Grand Duke of Inappropriate Announcements

  • Patron
  • PipPipPipPipPip
  • 33915 posts
  • LocationKnee deep in business plans

Posted 25 May 2016 - 08:25 AM

His brain hurts and he's writing gibberish that looks like alien script. I think he's been visited by aliens.

 

I vote that we abduct codemonkey and either dissect him or stick a tracking device up his butt...


  • 0

#8 Buzz Buzzard

Buzz Buzzard

    Comptroller of Fanatical Political Expressionism

  • Members
  • PipPipPipPipPip
  • 12316 posts
  • LocationHere, not there.

Posted 25 May 2016 - 08:47 AM

I worked 10 hours yesterday on an 8 meg xml file looking for a couple hundred errors.

 

I know how to party.

 

Gotta love 'caused by null'


  • 0

#9 codemonkey

codemonkey

    Ass. Comptroller of Ferthdays

  • Members
  • PipPipPipPipPip
  • 18916 posts
  • LocationMy suburban paradise

Posted 25 May 2016 - 08:54 AM

Sounds like a job for Python!
  • 0

#10 Genesee Ted

Genesee Ted

    yabba dabba doob

  • Moderators
  • PipPipPipPipPip
  • 41478 posts
  • LocationRochester, NY

Posted 25 May 2016 - 02:51 PM

It's all over my head

#11 badogg

badogg

    Comptroller of jokes about violence against women

  • Patron
  • PipPipPipPipPip
  • 28502 posts
  • LocationRight behind you!

Posted 25 May 2016 - 04:13 PM

So is the issue that the max function knows how to handle and parse the explicit numeric inputs of 5 6 etc, whereas Maximum is expecting to pull it out of a named dimensioned array?  The error is weird for sure, but I gotta say that is pretty cool to have the two similar functions to do those two different tasks.  I might be reading that wrong as I'm sure you remember my coding is limited to a specific language that looks very different.  So I apologize if my interpretation and question is beyond stupid.  :)


  • 0

#12 EWW

EWW

    Regular, normal human being

  • Patron
  • PipPipPipPipPip
  • 23206 posts
  • LocationSomewhere special

Posted 25 May 2016 - 04:45 PM

Agreed on the brain hurt ... #### the world and Georgia

I really don't know how a parent can lock up an adult child and threaten to mutilate them and their young child.

I don't follow the rest of this thread

Shots?
  • 0

#13 codemonkey

codemonkey

    Ass. Comptroller of Ferthdays

  • Members
  • PipPipPipPipPip
  • 18916 posts
  • LocationMy suburban paradise

Posted 25 May 2016 - 07:07 PM

So is the issue that the max function knows how to handle and parse the explicit numeric inputs of 5 6 etc, whereas Maximum is expecting to pull it out of a named dimensioned array?  The error is weird for sure, but I gotta say that is pretty cool to have the two similar functions to do those two different tasks.  I might be reading that wrong as I'm sure you remember my coding is limited to a specific language that looks very different.  So I apologize if my interpretation and question is beyond stupid.   :)

Naw, that wasn't my point. The maximum function actually uses max in it's implementation. It makes sense - max operates on two arguments (one, actually, but that's going deep down the Haskell rabbit hole) while maximum works on lists. What I found crazy was how cryptic the error message was. If you had enough knowledge of the language to understand it, you probably wouldn't have made the error in the first place.


  • 0

#14 badogg

badogg

    Comptroller of jokes about violence against women

  • Patron
  • PipPipPipPipPip
  • 28502 posts
  • LocationRight behind you!

Posted 25 May 2016 - 07:27 PM

Naw, that wasn't my point. The maximum function actually uses max in it's implementation. It makes sense - max operates on two arguments (one, actually, but that's going deep down the Haskell rabbit hole) while maximum works on lists. What I found crazy was how cryptic the error message was. If you had enough knowledge of the language to understand it, you probably wouldn't have made the error in the first place.


Did my question make me sound smart though? Lol
  • 0



Also tagged with one or more of these keywords: science

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users