kuribas 2017-03-02 08:45:23
I don't want it to descent into the expression...
shapr 2017-03-02 08:46:25
gutentag AALLEE, wie geht es?
kuribas 2017-03-02 08:47:07
please tell me, how do I keep ghci from descending into the expression?
davean 2017-03-02 08:47:46
kuribas: what are you talking about?
kuribas 2017-03-02 08:47:57
davean: the ghci debugger
kuribas 2017-03-02 08:48:24
davean: I force _result, but it keeps descending into the expression...
davean 2017-03-02 08:48:25
kuribas: you want to not have it show the evaluation?
kuribas 2017-03-02 08:48:30
davean: no
davean 2017-03-02 08:48:54
kuribas: tracing the evaluation is exactly the thing it does
kuribas 2017-03-02 08:49:16
davean: why would I care about the whole evaluation?
kuribas 2017-03-02 08:49:25
davean: I forced _result for a reason...
davean 2017-03-02 08:49:37
If you don't, why are you using the debugger?
kuribas 2017-03-02 08:49:58
davean: so it can show me the relevant parts...
SomeT 2017-03-02 08:50:24
ok I wiped haskell from my system
kuribas 2017-03-02 08:50:30
davean: it's the _result from a subexpression.
kuribas 2017-03-02 08:50:35
davean: which I don't particularly care about.
SomeT 2017-03-02 08:50:57
on a mac using the software 'haskell for mac' in terms of installing moo shall I install these: http://support.hfm.io/1.3/HaskellCLI-7.10.3-5.18-2.html or shall I install haskell via brew or both?
kuribas 2017-03-02 08:51:50
davean: I just want to skip it.
AWizzArd 2017-03-02 08:54:27
Is it possible to force ghc to output a binary, even in the presence of type errors
Sornaensis 2017-03-02 08:55:41
yea you can use unsafeCoerce I guess
ski 2017-03-02 08:55:54
AWizzArd : `-fdefer-type-errors' ?
AWizzArd 2017-03-02 08:56:06
ski: thx
Sornaensis 2017-03-02 08:56:11
ski: how does that work
Sornaensis 2017-03-02 08:56:28
type errors at runtime?
ski 2017-03-02 08:56:33
yes
thatguy 2017-03-02 09:14:15
what do I need to install to use https://hackage.haskell.org/package/hmatrix-0.18.0.0/docs/Numeric-LinearAlgebra-Data.html ?
thatguy 2017-03-02 09:14:37
nvm
suppi 2017-03-02 09:15:03
SomeT: best idea i have is to install ghc and cabal binaries and learn how to use them and cabal sandboxes
suppi 2017-03-02 09:15:16
i'm not sure which version will work with the package you want
suppi 2017-03-02 09:15:21
maybe search by date
suppi 2017-03-02 09:17:56
a maybe better way to solve your problem is to modify the source of the package that gives you trouble
suppi 2017-03-02 09:19:33
this might help for cabal sandboxes: http://katychuang.com/cabal-guide/
abhiroop 2017-03-02 09:22:10
Can someone explain what the ⇓ symbol means in PL theory
Cale 2017-03-02 09:23:20
abhiroop: Perhaps "reduces to"? It's hard to say for certain without more context.
abhiroop 2017-03-02 09:24:26
As an example I can provide this ⟨BC, σ0⟩ ⇓ ⟨B · BC, σn⟩ but then I would have to explain all the other variables
thatguy 2017-03-02 09:24:45
if I don't want to lazily return x + s*x' but want the function to actually compute it, how do I do that?
lyxia 2017-03-02 09:24:54
abhiroop: that looks like a reduction relation
abhiroop 2017-03-02 09:24:59
I thought this has a uniform meaning eg : Γ means an environment in any context
johnw 2017-03-02 09:25:18
thatguy: return $! x + s*x
dolio 2017-03-02 09:26:01
What if Γ means the gamma function?
thatguy 2017-03-02 09:26:04
so fun x x' s = ! x + s*x' ? johnw
johnw 2017-03-02 09:26:28
oh, you didn't mean do-notation return
suppi 2017-03-02 09:26:31
abhiroop: i think 'evaluates to' or 'reduce to' as cale said
johnw 2017-03-02 09:26:58
there's no way for your function to force its own evaluation, that's the caller's job; it can only force the arguments it must evaluate _when it is evaluated_
thatguy 2017-03-02 09:27:20
ah how would I force it as the caller?
johnw 2017-03-02 09:27:57
one way: let !x = myfun blah blah in use x...
johnw 2017-03-02 09:28:52
but still, this only happens when the result of *that* expression is needed
thatguy 2017-03-02 09:28:52
is that considered good practice or should I try to let the stuff evaluated when it is passed as argument?
johnw 2017-03-02 09:28:58
in general I'd say don't worry about strictness until you need to
thatguy 2017-03-02 09:29:11
I am calculating someting which will have the form of x + s*x' + s*x'' + s*x''' + .... and don't want to carry that around with me
thatguy 2017-03-02 09:29:14
in case it gets long
thatguy 2017-03-02 09:29:48
all the xs will also be vectors which scales the whole thing again in memory
thatguy 2017-03-02 09:31:06
johnw, ok thanks then maybe I'll try without strictness for now
thatguy 2017-03-02 09:31:13
but I have the feeling it would be appropriate here
johnw 2017-03-02 09:31:16
I'm not sure if this is the right answer for your situation, but if you want to write pure code that forces results everywhere possible, you might consider: https://hackage.haskell.org/package/strict-identity-0.1.0.0/docs/Control-Monad-StrictIdentity.html
thatguy 2017-03-02 09:33:33
johnw, I will have a look, thank you
johnw 2017-03-02 09:33:49
my spidey sense tells me this isn't the right answer, though
johnw 2017-03-02 09:33:59
so come back if the lazy approach fails
thatguy 2017-03-02 09:35:10
:D I'll trust in your spidey sense that
thatguy 2017-03-02 09:35:17
*then
ski 2017-03-02 09:35:19
abhiroop : presumably a big-step operational semantics
abhiroop 2017-03-02 09:36:49
Thanks ski and others
abhiroop 2017-03-02 09:37:05
This actually is big step operational semantics
abhiroop 2017-03-02 09:37:40
Corresponding small step operational semantic would e1 --> e1' --> e2
abhiroop 2017-03-02 09:37:58
So I guess it translates to "reduces to"
ski 2017-03-02 09:39:37
"finally reduces to"
codedmart 2017-03-02 09:52:50
Did something change in aeson with parsing integers and floats? I upgrading and now I am seeing an error `Floating number specified for Integer`
umib0zu 2017-03-02 09:57:58
Hey Haskell. I had a question about Least Fixed Point Semantics here if anyone is interested. https://www.reddit.com/r/AskComputerScience/comments/5x5mkb/why_is_least_fixed_point_semantics_for_recursion/
thatguy 2017-03-02 10:08:34
can anyone tell me why 3.0*vector [1,2] works but let a = 3 :: Double, a * vector [1,2] gives me "couldn't match types?"
ski 2017-03-02 10:09:23
presumably in the former case `3.0' is a vector ?
thatguy 2017-03-02 10:09:59
ski, can I somehow check which type it has in the former case?
ski 2017-03-02 10:10:59
doesn't "couldn't match types?" tell you the involved types ?
ski 2017-03-02 10:11:29
if it's the ordinary `(*)', then it should be the same type as the type of `3.0*vector [1,2]'
thatguy 2017-03-02 10:11:47
ski, it only tells me in the case it does not work
thatguy 2017-03-02 10:12:02
3.0 * vector [1,2] does what I thought it would: [3.0, 6.0]
thatguy 2017-03-02 10:12:09
the other one gives me the type missmatch
ski 2017-03-02 10:12:17
between which two types ?
thatguy 2017-03-02 10:12:39
Couldn't match expected type 'Double' with actual type 'Vector ℝ'
thatguy 2017-03-02 10:12:47
where type R = Double
thatguy 2017-03-02 10:13:35
I'm actually pretty impressed that the library used this fancy R for the real numbers
Tuplanolla 2017-03-02 10:14:23
I'm annoyed by it, because it's actually `Double`.
ski 2017-03-02 10:14:40
ok, so the type of `3.0' there is `Vector Double'
thatguy 2017-03-02 10:15:38
so to do scalar multiplication I have to convert my Double to a vector Double and then multiply them?
thatguy 2017-03-02 10:15:54
is that the good practice way or would it be more haskelly to use the Vector.map function?
thatguy 2017-03-02 10:17:14
Tuplanolla, but still I have to admit no other console application spitted me out such fancy mathbb letters until now
Tuplanolla 2017-03-02 10:17:49
You need APL in your life.
thatguy 2017-03-02 10:18:42
Tuplanolla, what is that?
shapr 2017-03-02 10:19:22
A Programming Language
Tuplanolla 2017-03-02 10:19:32
@google apl, a programming language
lambdabot 2017-03-02 10:19:33
https://en.wikipedia.org/wiki/APL_(programming_language)
Rembane 2017-03-02 10:19:38
J!
shapr 2017-03-02 10:19:43
https://en.wikipedia.org/wiki/APL_(programming_language)
shapr 2017-03-02 10:19:47
Tuplanolla: beat me to it
shapr 2017-03-02 10:20:30
I never did track down an IBM Selectric typewriter APL font golf ball.
kuribas 2017-03-02 10:20:46
The ghci debugger is broken...
shapr 2017-03-02 10:23:00
kuribas: fix it?
kuribas 2017-03-02 10:23:10
shapr: I am not a ghc expert...
thatguy 2017-03-02 10:23:12
:D "A Programming Language" that is a hint what to search for on the one hand and a complete solution on the other hand
thatguy 2017-03-02 10:23:13
Tuplanolla, from wikipedias first sentence "It uses a large range of special graphic symbols[11] to represent most functions and operators" you are right, it seems I would enjoy it
thatguy 2017-03-02 10:23:14
short at least
thatguy 2017-03-02 10:23:33
so can anyone tell me if there is any difference between using the Vector.map function or converting the scalar to a Vector before multiplying?
kuribas 2017-03-02 10:25:10
thatguy: Vector.map is probably more efficient.
kuribas 2017-03-02 10:25:28
As you don't create another vector.
Tuplanolla 2017-03-02 10:25:42
I wonder if there's a rewrite rule for this.
Tuplanolla 2017-03-02 10:26:06
That would not be surprising.
thatguy 2017-03-02 10:26:14
hmm I just saw that I was confusing the libraries. Vector.map is from the Vector library, I am now using the hmatrix library
thatguy 2017-03-02 10:27:35
but then I'll use fmap
thatguy 2017-03-02 10:27:58
Thanks everyone for helping, I'm gone for today, have a nice evening/day
Nolrai 2017-03-02 10:30:53
Okay so is there a way to have the type wittness what exceptions are thrown by a pure function?
Nolrai 2017-03-02 10:31:35
Even if I am not planing on catching the exception?
davean 2017-03-02 10:31:40
Nolrai: no
Nolrai 2017-03-02 10:31:44
Okay.
Nolrai 2017-03-02 10:31:48
Thanks!
davean 2017-03-02 10:32:01
Nolrai: so, its not even generally theoretically possible
davean 2017-03-02 10:32:11
Nolrai: if you think about it, whats the set of exceptions that might be thrown?
Nolrai 2017-03-02 10:32:19
Right.
Tuplanolla 2017-03-02 10:32:23
@hackage directory
lambdabot 2017-03-02 10:32:23
http://hackage.haskell.org/package/directory
Tuplanolla 2017-03-02 10:32:31
Exceptions are usually documented like this.
davean 2017-03-02 10:32:33
Nolrai: for example bottoms
davean 2017-03-02 10:32:48
we get into a computability issue
monochrom 2017-03-02 10:33:06
I don't think we include bottom as an exception.
davean 2017-03-02 10:33:24
monochrom: some throw exceptions
Nolrai 2017-03-02 10:35:21
Stack overflows, and blackholes for example.
Nolrai 2017-03-02 10:39:06
Hmm. What I should probably really do is explicitly build a error hierarchy and use the Except monad. I wish the type checker could build the sum type for me. That is probably silly of me.
davean 2017-03-02 10:39:24
Nolrai: that already exists
Nolrai 2017-03-02 10:39:32
It does?
davean 2017-03-02 10:39:41
Nolrai: https://hackage.haskell.org/package/control-monad-exception
monochrom 2017-03-02 10:40:19
It is a simplifying and coarse denotational semantics to lump non-termination and head [] (for example) together as "the same" bottom. It makes the math more beautiful. It doesn't mean that we always have to limit ourselves that way. head [] takes very much finite running time to detect.
davean 2017-03-02 10:41:06
monochrom: I never said it was the same ones
davean 2017-03-02 10:41:28
I said you couldn't type all potential exceptions in Haskell's type system
Tuplanolla 2017-03-02 10:41:46
I can't imagine a better way to go insane.
jacqueline[m] 2017-03-02 10:42:09
So...what is "sane" anyway?
jacqueline[m] 2017-03-02 10:42:17
That's just a matter of semantics :D
monochrom 2017-03-02 10:42:33
But you used the wrong reason, or I misread your reason.
davean 2017-03-02 10:43:29
monochrom: I said there was a computability issue
davean 2017-03-02 10:43:41
I never said anything about partial functions in any way shape or form
monochrom 2017-03-02 10:43:44
Then I read correctly. That's the wrong reason.
davean 2017-03-02 10:43:54
monochrom: no?
monochrom 2017-03-02 10:44:29
Because running into head [] is not a computability issue.
davean 2017-03-02 10:44:57
monochrom: Haskell's type system is litterly insufficient to type the exceptions a pure function can throw
davean 2017-03-02 10:44:57
monochrom: I never said it was
davean 2017-03-02 10:44:57
monochrom: I said noything about "head []" in any way
davean 2017-03-02 10:44:57
monochrom: I didn't say there were no exceptions it couldn't type
davean 2017-03-02 10:44:57
I said there were ones it couldn't
davean 2017-03-02 10:44:57
My proof was an existance proof, not a completeness proof