« first day (970 days earlier)      last day (896 days later) » 

00:46
@AaronHall quick question
add_two num_one num_two = num_one + num_two
a = 3
b = 4
l = add_two a b
main = print l
what's the question?
How would you add the squares of a and b and print the output?
l = add_two a*a b*b throws an error.
do you have to use add_two?
I'd do something like this:
λ: sum (map (** 2) [1,2])
5.0
in Python we prefer list and generator comprehensions over map, but in Haskell, I'm not aware of a preference...
1 hour ago, by MisterGeeky
lol. "we do not wish to add to this Tower of Babel"
probably meaning they don't want to confuse by adding to more jargon from various fields...
@AaronHall yes, and so, add_two num_one num_two = num_one**2 + num_two**2 works just as well :)
:/ wish this room had syntax highlighting. Would have been neat.
@MisterGeeky I suppose.
00:58
Mhh.. No, I actually get a 25.0 where I should get a 25.
is there an int() BIF?
the problem with trying to answer your question is I don't know your constraints, e.g. I didn't realize you would want to change that function.
you can declare the type with :: Int, I believe.
add it to the end of the l = line.
maybe pass to round?
λ: round $ sum(map (** 2) [1,2])
5
I just did main = print 25 and it let me pass xD
Since ** returns a Double you can't just coerce it to Int I guess...
01:05
yeah, figured that.
@AaronHall I can't get that to compile. Does it work for you?
@MisterGeeky the lambda indicates it came from my terminal, I'm using GHCI version 8.4.4
omg, I thought that was an anonymous function all this time. Wow. Thanks for clearing that up.
hmmm... I wonder if I should change that then...
@user9120385 welcome!
round $ sum(map (** 2) [1,2])
=> 5
Yes, it works :) thanks!
Haskell seems like a language where one doesn't really want to use the defaults.
A lot of people talk about using an optimized/custom prelude, for example, and I don't really like the convention of GHCI showing you the imported libs in the PS1.
@MisterGeeky someone proposed adding an output prefix so that you could prefix output with -- or some other kind of indicator.
01:13
@AaronHall That's always been $~ or #~ for me.
oh.
@MisterGeeky ? I'm talking about a (closed/won't-fix) bug report.
oh, you mean your PS1.
yeah. Weird that you call it that.
I'm not very versed with the nuances.
One of my earliest toots was about this.
prompt and prompt-cont are more appropriate for Haskell.
here's my .ghci file:
:set +m
:set prompt  "λ: "
:set prompt-cont " | "
@AaronHall I'm on windows 7, I'm not sure where to put that.
Python calls it a ps1 though:
>>> import sys
>>> sys.ps1
'>>> '
See, that triple chevron is an input standard
In python, outputs have echo off for the PS1 usually.
Post-execution, we return the systems usual PS1. If that makes sense.
It doesn't make sense to me, as I understand it, sys.ps1 is defined to be the initial prompt for user input, and nothing needs to be turned off. sys.ps2 is the prompt for continued input ('... ').
01:24
I think i'd have to dwell a bit into python env and interpreter instances for that to make sense. Essentially, python.exe is the interpreter and as a CLI has it's own i/o standards. Input set with ps1 change and output set with redefining print.
@MisterGeeky put your .ghci file in your home directory. That might be the working directory where Windows drops you when you open cmd.exe..
typically C:/Users/[user] (not-admin)
@MisterGeeky try putting it there.
@AaronHall I've saved this as a.ghci
+m enables multiline input (without special characters) and I presume you grock the rest.
01:31
still the old prompt, actually.
You can also set modules to be imported in your .ghci
Did you restart your ghci session?
I restarted cmd a few times :/
oh dot for hidden
dot makes it "hidden" on unix but Windows doesn't follow that convention.
try something like: echo %userprofile%
01:36
that's just my cwd :/
so that should do it. apparently it first looks in your current working directory anyways.
the actual and complete name of the file should be: .ghci
nothing in front of that.
I did copy a.ghci .ghci
reloaded the session. still nada.
that's it, time to delete Windows.
:)
:D :D :D
nah, it's my fault.
I can't do any of this because this is my mom's admin locked system from her office.
ie, no .exe can be installed without a password.
01:54
well .ghci is a config file and you should be able to create such a file in your home directory.
I did that much. The thing won't run without the application apparently. (ie, I don't have ghci on my machine)
I recommend getting a cheap laptop, and installing linux on it.
lol, I'll get it next week :D It was Rs. 21,000 and lasted me 1.5 years before giving up.
Need to call the repair shop today. Thanks for reminding me.
But you definitely need to install Haskell to be able to use it. You might be able to install it in a local area for just your user... maybe.
I was hoping to continue learning with repl.it alone
Isn't there like a Kaggle notebook?
02:01
Maybe, just don't try to set options in repl.it, I guess.
which I suppose means you can't use +m
xD I'm sure it's possible in some hackey way.
too bad.
Just do multiline stuff in the file on the left-hand side...
@AaronHall if you're interested, you could make a course there, i think.
02:17
@MisterGeeky I'm sure
There's not much to find on Haskell Currying, afaik.
02:34
Ooh, "Prelude is a module that contains a small set of standard definitions and is included automatically into all Haskell modules."
 
3 hours later…
05:29
"small" lol
Should probably change that to "large"...
autocomplete on the module:
Display all 255 possibilities? (y or n)
Prelude.!!                      Prelude.fromInteger
Prelude.$                       Prelude.fromIntegral
Prelude.$!                      Prelude.fromRational
Prelude.&&                      Prelude.fst
Prelude.*                       Prelude.gcd
Prelude.**                      Prelude.getChar
Prelude.*>                      Prelude.getContents
Prelude.+                       Prelude.getLine
...
 
6 hours later…
11:16
I actually slept 7 hours after that last post.
And had breakfast in the smack dab middle of the afternoon. I love life right now.
Dec 14 at 15:12, by MisterGeeky
https://trello.com/invite/b/InwzuMEu/06e87fa47bdb9cf5cca0efbfe6abcef7/programmin‌​g-paradigms
 
7 hours later…

« first day (970 days earlier)      last day (896 days later) »