pikajude 2017-03-02 06:45:21
kubunto: it's like >>=, but the second operand ignores the result of the first one
kubunto 2017-03-02 06:45:47
?
ski 2017-03-02 06:45:47
`(>>)' is a variant of `(>>=)' used when the second action one want to sequence after a first one doesn't need to depend on the computed result from the first
ski 2017-03-02 06:45:58
@src (>>)
lambdabot 2017-03-02 06:45:58
m >> k = m >>= \_ -> k
pikajude 2017-03-02 06:46:01
kubunto: x >> y === x >>= \ _ -> y
pikajude 2017-03-02 06:46:21
or that
kubunto 2017-03-02 06:46:33
so it doesnt modify whats inside the monad
ski 2017-03-02 06:46:55
a monad is not something which is passed around at run-time
pikajude 2017-03-02 06:47:06
a monad isn't necessarily a container
ski 2017-03-02 06:48:09
a monad is a type function, together with a couple of functions for operating on values (often called "actions") of a "monadic type", the functions are required to satisfy a few reasonable laws
ski 2017-03-02 06:48:38
as pikajude, the result of a monadic action isn't necessarily "inside" it
ski 2017-03-02 06:48:45
@type getLine
lambdabot 2017-03-02 06:48:49
IO String
ski 2017-03-02 06:49:07
is an I/O action. the string that is its result, when executed, is not contained inside it
pikajude 2017-03-02 06:49:11
@quote /bin/ls
lambdabot 2017-03-02 06:49:11
shachaf says: getLine :: IO String contains a String in the same way that /bin/ls contains a list of files
fresheyeball 2017-03-02 06:49:24
I know this already has to exist out there
fresheyeball 2017-03-02 06:49:26
newtype F a x = F (a -> x)
ski 2017-03-02 06:49:29
`getLine' is just a "recipe" for how to obtain a string, by communicating with the operating system (possibly communicating with the external world)
fresheyeball 2017-03-02 06:49:38
is there a name for `F` that is out there already?
ski 2017-03-02 06:49:42
fresheyeball : `Reader' ?
ski 2017-03-02 06:49:46
@src Reader
kubunto 2017-03-02 06:49:47
so when i type "a <- getline" that would be using monads?
lambdabot 2017-03-02 06:49:47
type Reader r = ReaderT r Identity
lambdabot 2017-03-02 06:49:47
--OR
lambdabot 2017-03-02 06:49:47
data Reader r a = Reader { runReader :: r -> a }
fresheyeball 2017-03-02 06:50:06
sweet!
dolio 2017-03-02 06:50:07
fresheyeball: (->)
ski 2017-03-02 06:50:26
kubunto : the `<-' symbol is part of the `do'-notation syntax, which is implicitly translated to calls to `(>>=)' and `(>>)', so yes
pikajude 2017-03-02 06:50:34
"using monads" is a very vague phrase
pikajude 2017-03-02 06:50:40
but yes
fresheyeball 2017-03-02 06:50:47
is there a default implimentation for Reader outside of MTL?
ski 2017-03-02 06:52:21
@undo do {x <- Just 2; y <- Nothing; return (x + y)}
lambdabot 2017-03-02 06:52:21
Just 2 >>= \ x -> Nothing >>= \ y -> return (x + y)
ski 2017-03-02 06:52:51
kubunto : that shows how `do'-notation gets translated to calls to `(>>=)' (and `(>>)', though it doesn't occur in this example)
ski 2017-03-02 06:52:56
@src Maybe (>>=)
lambdabot 2017-03-02 06:52:56
(Just x) >>= k = k x
lambdabot 2017-03-02 06:52:56
Nothing >>= _ = Nothing
fresheyeball 2017-03-02 06:53:07
ski: is Reader a Monoid?
ski 2017-03-02 06:53:26
`Reader rho' is a *monad* (not a monoid), for any type `rho'
ski 2017-03-02 06:54:04
.. it would also be possible to make `Reader rho a' a monoid, if `a' is a monoid, for any types `a' and `rho'
c_wraith 2017-03-02 07:02:41
the underlying type, without the Reader wrapper, already has that Monoid instance!
thatrandomguy 2017-03-02 07:29:44
Do I have the right feeling that haskell just doesn't lend itself very well to numerical mathematics? I mean it starts right at n-dimensional fields, I have no way to do functions that work on general n-dimensional fields which I defined since I cannot have generic n-tuples. Then if I want to do stuff like numerical simulation or Control of Differential equations the whole problem is that you have some state and you simulate and see ho
thatrandomguy 2017-03-02 07:29:44
w the state evolves over time
thatrandomguy 2017-03-02 07:30:07
Am I just to new to haskell to understand how it is done or should I look out for a multi-paradigm language?
kuribas 2017-03-02 07:30:46
when debugging, what is the difference between evaluating an expression, and :forcing it?
kuribas 2017-03-02 07:31:24
thatrandomguy: numerical computation is normally don't on vectors.
kuribas 2017-03-02 07:31:41
thatrandomguy: or matrixes (which usually use vector underneat).
kuribas 2017-03-02 07:31:54
s/don't/done
gmalecha 2017-03-02 07:32:27
is it possible to import the name of a type family but not import its equations?
ski 2017-03-02 07:32:36
@hackage ad
lambdabot 2017-03-02 07:32:36
http://hackage.haskell.org/package/ad
ski 2017-03-02 07:32:48
"Forward-, reverse- and mixed- mode automatic differentiation combinators with a common API."
Sornaensis 2017-03-02 07:32:50
thatrandomguy: yea it sounds like you want vectors, not tuples
thatrandomguy 2017-03-02 07:33:42
yeah ok maybe I should look further into it first
kuribas 2017-03-02 07:34:06
thatrandomguy: you can use immutable state, or use the ST-monad.
thatrandomguy 2017-03-02 07:34:22
somehow I read the whole tutorial, did all tasks and it was really fun but as soon as I start to think about the stuff I want to do on my own I have a feeling that haskell is not sooo suitable for this as the tutorial tasks where
thatrandomguy 2017-03-02 07:34:34
they where nearly exclusively about parsing
Cale 2017-03-02 07:34:48
were?
thatrandomguy 2017-03-02 07:35:08
Cale, are you asking which tutorial?
Cale 2017-03-02 07:35:23
No, you probably meant "they were"
thatrandomguy 2017-03-02 07:35:46
yes, that is what I meant, thank you
kuribas 2017-03-02 07:35:58
thatrandomguy: haskell lacks support for numerical programs, compared to Python or Julia...
thatrandomguy 2017-03-02 07:36:10
ok thanks everyone I will try to do the stuff with the vector package now
kuribas 2017-03-02 07:36:12
thatrandomguy: but it's not a flaw of the language...
thatrandomguy 2017-03-02 07:36:22
yes pythons numpy is really just the dream of dreams
kuribas 2017-03-02 07:36:41
I'd say haskell is more suited than python.
mnoonan 2017-03-02 07:36:50
thatrandomguy: you may also be interested in Accelerate, at least down the road: https://hackage.haskell.org/package/accelerate-0.15.1.0/docs/Data-Array-Accelerate.html
kuribas 2017-03-02 07:38:06
My feeling about GPU in haskell is that it rarely is worth it.
thatrandomguy 2017-03-02 07:38:07
kuribas, I hope so
thatrandomguy 2017-03-02 07:38:21
I really like haskell and the abstraction it brings
thatrandomguy 2017-03-02 07:38:42
mnoonan, thanks I'll keep that in mind in case I need it
thatrandomguy 2017-03-02 07:38:48
thanks everyone for helping
Cale 2017-03-02 07:39:16
You might find hmatrix helpful
fresheyeball 2017-03-02 07:39:21
I just published a thing http://hackage.haskell.org/package/Empty-0.1.0.0/docs/Control-Empty.html
Cale 2017-03-02 07:40:20
fresheyeball: "annihilation"
thatrandomguy 2017-03-02 07:41:13
Cale, that does look like a good companion for vector
Cale 2017-03-02 07:41:46
thatrandomguy: http://hackage.haskell.org/package/hmatrix-0.18.0.0/docs/Numeric-LinearAlgebra.html
fresheyeball 2017-03-02 07:41:51
Cale: oops