Search Haskell Channel Logs

Saturday, February 4, 2017

#haskell channel featuring pavonia, noan, tfc, ph88, Welkin, opqdonut, and 5 others.

xcmw 2017-02-04 03:54:10
& is to >>> as <&> is to what? (a -> m b) -> (b -> c) -> a -> m c
xcmw 2017-02-04 03:59:38
Anyone know what operator does that?
c_wraith 2017-02-04 04:00:00
doesn't look familiar.
tfc 2017-02-04 04:08:07
i would like to append "-isome_folder" to my "stack ghci" command line, but i am unable to figure out. can anyone help me?
EckT_ 2017-02-04 04:08:51
maybe stack ghci -- -isome_folder?
tfc 2017-02-04 04:09:21
then it tells me "Error parsing targets: Directory not found: -isrc"
tfc 2017-02-04 04:09:37
but the directory is correct.
c_wraith 2017-02-04 04:10:58
is it possible stack is changing the cwd before running ghci?
c_wraith 2017-02-04 04:11:15
try using an absolute path to the directory
tfc 2017-02-04 04:12:39
yes, it is possible, but i am going to tell it ":load SomeHaskellModule", which is in $CWD, but imports other modules from a completely different folder. that's why i want to use -I$folder
c_wraith 2017-02-04 04:12:56
ah, I see.
c_wraith 2017-02-04 04:13:12
I suspect you've just found a case stack wasn't built for.
c_wraith 2017-02-04 04:13:25
it's very project-oriented
tfc 2017-02-04 04:13:54
hm. i would like to play with functions from my project
tfc 2017-02-04 04:14:05
looks like it's not possible to mix app/ and src/ files in ghci then
c_wraith 2017-02-04 04:14:07
you could add the source dir interactively, maybe?
c_wraith 2017-02-04 04:14:22
in ghci, :set -idir
tfc 2017-02-04 04:14:27
oh that sounds great
tfc 2017-02-04 04:14:55
yeah that works perfect
tfc 2017-02-04 04:14:58
thank you!
c_wraith 2017-02-04 04:15:03
you're welcome
iwmrby 2017-02-04 04:15:27
Hey. How can I refer to the current object in Haskell? I am trying to use an element from a Matrix while building the Matrix.
iwmrby 2017-02-04 04:16:26
let a = matrix 3 2 $ \(i, j) -> if i == 1 then 1 else if j == 1 then 1 else (getElem i (j-1) a + getElem (i-1) (j-1) a + getElem (i-1) j a)
iwmrby 2017-02-04 04:16:43
^this works, but I want not to use `let a =`. Is there a way?
michaelt 2017-02-04 04:17:50
iwmrby: you are using the matrix library?
c_wraith 2017-02-04 04:18:10
iwmrby: haskell doesn't have any concept of "the current object"
iwmrby 2017-02-04 04:18:18
michaelt: Because I need a matrix.
iwmrby 2017-02-04 04:18:35
c_wraith: oh. I will use let then. Thanks! I tought there maybe was a way
iwmrby 2017-02-04 04:18:50
michaelt: is there something wrong with Matrix?
c_wraith 2017-02-04 04:19:00
iwmrby: I think he was just asking *which* library you're using
michaelt 2017-02-04 04:19:13
yes
iwmrby 2017-02-04 04:19:31
Oh. Yes. Apoogies. I am using Data.Matrix
Welkin 2017-02-04 04:19:37
apoogies
michaelt 2017-02-04 04:19:37
the library is using a vector to represent a matrix
noan 2017-02-04 04:19:47
Anyone know where I can find an example of using a request header in servant?
iwmrby 2017-02-04 04:20:07
Welkin: :)) It's clear, I need sleep.
Welkin 2017-02-04 04:20:10
noan: #haskell-servant is a good place to ask servant-secific questions
Welkin 2017-02-04 04:20:18
specific*
noan 2017-02-04 04:20:27
Welkin, cheers
michaelt 2017-02-04 04:20:49
iwmrby: such a thing needs to be built all at once. you might want `Data.Array`
noan 2017-02-04 04:21:11
Welkin, if that weren't an empty channel of course.
Welkin 2017-02-04 04:21:32
oh?
Welkin 2017-02-04 04:22:01
oh yes
Welkin 2017-02-04 04:22:03
#servant
noan 2017-02-04 04:22:06
ty
michaelt 2017-02-04 04:28:06
iwmrby: look at the definition of the array `a` here https://hackage.haskell.org/package/array-0.5.1.1/docs/Data-Array.html#v:array
michaelt 2017-02-04 04:30:00
iwmrby: it is using a list comprehension two build a 1-d array which isn't as interesting but builds it by referring to elements of the array it is defining
michaelt 2017-02-04 04:30:29
iwmrby: this won't be possible with the matrix library if I understand
opqdonut 2017-02-04 04:37:24
it seems vacuum doesn't support GHC>7.8
Welkin 2017-02-04 04:37:39
what's that?
opqdonut 2017-02-04 04:37:56
a debugging / visualization tool that can draw pictures of your stack
opqdonut 2017-02-04 04:38:55
e.g. https://www.youtube.com/watch?v=A1wtQ_mYHHo
opqdonut 2017-02-04 04:39:56
https://hackage.haskell.org/package/ghc-heap-view seems like an alternative but it too says "Currently, GHC 7.4 through 7.10 should be supported."
opqdonut 2017-02-04 04:40:40
heh looks like ghc-heap-view just got ghc 8 support: https://github.com/nomeata/ghc-heap-view/commits/master
ph88 2017-02-04 04:41:27
if i have a string like "foo\"bar" and i want to enclose it with double quotes like so "\"foo\"bar\"" how can i make a parser function so that the parser "gives back" the last " in case it's needed to end the quoted string?
pavonia 2017-02-04 04:44:37
ph88: You just need to escape all "s and \s in the string
michaelt 2017-02-04 04:44:39
iwmrby: or rather, it's possible with this generator function, but you will have to build and rebuild the (partially undefined) vector for each element of the matrix, if I understand
ph88 2017-02-04 04:44:41
hhmm actually i'm not sure if i put the requirement to escape the inner quote ^^ let me check that first