Search Haskell Channel Logs

Saturday, February 4, 2017

#haskell channel featuring geekosaur, EvanR, jle`, zipper, erisco, vektorweg1, and 9 others.

benzrf 2017-02-04 12:50:14
q_q
Gurkenglas 2017-02-04 12:52:46
benzrf, this might help? https://github.com/search?q=%22cannot+find+normal+object+file%22+%22while+linking+an+interpreted+expression%22&type=Code&utf8=%E2%9C%93
benzrf 2017-02-04 12:53:46
We could not perform this search
benzrf 2017-02-04 12:53:49
:p
geekosaur 2017-02-04 12:53:50
benzrf, sounds like ihaskell was built for profiling and therefore is linked to a profiling ghc-api
benzrf 2017-02-04 12:54:21
geekosaur: i dont think so, though.... i'm using Nix, and i think profiling is off by default :?
Gurkenglas 2017-02-04 12:54:54
Wat but it just worked for me and now it doesnt anymore
Gurkenglas 2017-02-04 12:56:14
Try clicking through the four language options at the bottom left? That seems to bring back up disjunct portions of the 37 results
Ptival 2017-02-04 12:56:33
is there a type class capturing the existence of a lens?
benzrf 2017-02-04 12:56:50
Ptival: depends on what you mean, thats a pretty vague question
benzrf 2017-02-04 12:57:00
Gurkenglas: not working - which repo is this meant to be searching in?
benzrf 2017-02-04 12:57:36
.......i got rate limited
Gurkenglas 2017-02-04 12:57:37
I did not provide a repo. And now it has also stopped working for the literate haskell option, but not yet for the haskell option - nevermind, now that has too
benzrf 2017-02-04 12:57:38
wtf
Gurkenglas 2017-02-04 12:57:59
Gah, here have the first result from my original search https://github.com/timthelion/fenfire/blob/766167d8c5b6829d7df43efdcc67cbbe6fe8db79/RESURECTION-NOTES.md
Ptival 2017-02-04 12:58:37
benzrf: I'm doing a "Trees that Grow" kind of encoding where I have a type with constructors | C1 (FC1 a) | C2 (FC2 a) | ...
Ptival 2017-02-04 12:59:15
and I wonder whether I can write a generic function that writes an Int within each (FCn a), assuming the respective type has an Int slot
benzrf 2017-02-04 12:59:43
:t makeClassy
lambdabot 2017-02-04 12:59:47
Language.Haskell.TH.Syntax.Name -> Language.Haskell.TH.Lib.DecsQ
benzrf 2017-02-04 12:59:50
hmm
Gurkenglas 2017-02-04 13:00:11
You can just define a "Traversal' YourTree a" and apply that when a has Int
Profpatsch 2017-02-04 13:00:13
Gurkenglas: fenfire looks so cool!
Profpatsch 2017-02-04 13:00:23
I've been wanting to have something like that for ages.
Profpatsch 2017-02-04 13:00:48
That is: Just jot down various RDF triples with relations I can define myself.
Profpatsch 2017-02-04 13:00:58
And then make sense of them later when I need to.
Gurkenglas 2017-02-04 13:01:16
I literally took the first result from some github search - maybe you should just start randomly browsing through github haskell projects :D
Ptival 2017-02-04 13:01:50
Gurkenglas: I'll look into Traversal, don't really know them, what do you mean by "a has Int" though?
benzrf 2017-02-04 13:01:54
Gurkenglas: hmm....... but my error is complaining about no dyn_o, not no p_o
Gurkenglas 2017-02-04 13:01:59
(Or you were the one person idling in this channel that happened to be interested in this result, and are unlikely to find another hit quickly - though if the whole thread were watching, someone else would probably soon be interested in something)
Gurkenglas 2017-02-04 13:02:58
benzrf, try googling your exact error message
benzrf 2017-02-04 13:05:22
im not using template haskell at all :?
benzrf 2017-02-04 13:05:26
and all the results seem to be about it
benzrf 2017-02-04 13:05:33
does ihaskell use TH internally?
Tuplanolla 2017-02-04 13:06:09
That doesn't sound TH related, benzrf. The `dyn` refers to dynamically linked libraries.
benzrf 2017-02-04 13:06:27
Tuplanolla: all the results seem to be about TH
geekosaur 2017-02-04 13:06:39
oh, right, I misread that
geekosaur 2017-02-04 13:07:04
anyway, the linking factor there is that TH and ghc-api interpreted expressions (and ghci) all use the bytecode backend
benzrf 2017-02-04 13:07:10
aha
geekosaur 2017-02-04 13:07:22
and it's the bytecode backend's linker that is failing to load a module
benzrf 2017-02-04 13:07:24
more info:
benzrf 2017-02-04 13:07:41
i am 100% able to import and eval stuff from packages, e.g. import Data.MultiSet
benzrf 2017-02-04 13:07:55
the error is when i try to :load a .hs
benzrf 2017-02-04 13:08:09
furthermore, it loads fine and i can do :t and so on - it only errors when i try to eval an expr
benzrf 2017-02-04 13:08:20
and only if the expr references a definition from the file i loaded
benzrf 2017-02-04 13:08:36
i can confirm that there are no dyn_o files in the dir; only .o
geekosaur 2017-02-04 13:08:44
hm.
benzrf 2017-02-04 13:08:55
i am using Nix to set up my environment, for what thats worth
benzrf 2017-02-04 13:09:13
ghc 7.10.3
Profpatsch 2017-02-04 13:10:22
What was the ihaskell alternative that came up somewhere last month?
jle` 2017-02-04 13:10:24
erisco: did your question already get answered
erisco 2017-02-04 13:10:37
jle`, yeah I figured it out
jle` 2017-02-04 13:10:40
Profpatsch: there's haskell-do that i just heard about last week, if that's waht you mean
jle` 2017-02-04 13:10:43
erisco: ok neat :)
erisco 2017-02-04 13:11:00
working out the Enum instance for BoundedNat now
geekosaur 2017-02-04 13:11:07
actually I had thought ihaskell had been broken by ipython->jupyter and nobody had fixed it...
geekosaur 2017-02-04 13:11:27
(it's not just a rename, they rewoirked the impl in a way that broke ihaskell's assumptions)
jle` 2017-02-04 13:11:34
ouch
erisco 2017-02-04 13:11:36
getting close... just one last proof that needs to get in though I am not sure yet where it is coming from
benzrf 2017-02-04 13:12:21
oh!
benzrf 2017-02-04 13:12:32
id be happy to use something else - i just didnt know there were any alternatives
Profpatsch 2017-02-04 13:12:33
jle`: No, there was one before that.
geekosaur 2017-02-04 13:14:15
ok, looking at the repo, they actually did fix that to at least some extent
Profpatsch 2017-02-04 13:15:22
I tried setting up ihaskell a few hours back, but some deps don't compile on 8.x
benzrf 2017-02-04 13:15:44
ok, what are you guys talking about?
Profpatsch 2017-02-04 13:15:50
An apparently the nixos module is slightly broken so it ignores the different haskell package set I gave it.
benzrf 2017-02-04 13:15:57
if theres a nicer, newer alternative, id be happy to use it
erisco 2017-02-04 13:15:59
nailed it :D
erisco 2017-02-04 13:16:16
jle`, this stuff is quite fun... always the sort of thing I wanted to get into
Profpatsch 2017-02-04 13:16:31
benzrf: Nothing better than ihaskell right now I'm afraid.
benzrf 2017-02-04 13:16:57
:(
jle` 2017-02-04 13:17:18
erisco: i know how you feel haha
jle` 2017-02-04 13:17:23
have you read the idris book yet?
benzrf 2017-02-04 13:17:39
so why wouldnt it be generating dyn_o files if it expects them to be there?
benzrf 2017-02-04 13:17:42
i am so confused q_q
Profpatsch 2017-02-04 13:17:43
Right now I'd just like a thing that maps deep data structures to an expandable gui element
erisco 2017-02-04 13:17:56
no. I have tinkered with Idris briefly but became confused rather quickly. I feel a bit better here because at least I know Haskell
Profpatsch 2017-02-04 13:17:58
benzrf: There are a few approaches right now, like https://github.com/theam/haskell-do
Profpatsch 2017-02-04 13:18:09
And another project I forgot the name of.
Profpatsch 2017-02-04 13:18:27
Maybe I starred it (but probably not)
Profpatsch 2017-02-04 13:19:11
yeah, no, no star
erisco 2017-02-04 13:19:42
jle`, > [minBound..maxBound] :: [BoundedNat 'Z ('S ('S 'Z))] [Range SZ :: Range Z (S (S Z)),Range (SS SZ) :: Range Z (S (S Z))] :D
erisco 2017-02-04 13:20:43
erm, that sound read "BoundedNat" not "Range" ... I changed the name but not in the Show instance heh
EvanR 2017-02-04 13:21:18
is BoundedNat supposed to be like Fin
erisco 2017-02-04 13:21:34
I don't know what Fin is
EvanR 2017-02-04 13:21:55
Fin n is the type of numbers from zero to n-1
erisco 2017-02-04 13:22:06
ah, so bounded above
erisco 2017-02-04 13:22:12
well this has a min bound too so it is more general
EvanR 2017-02-04 13:23:02
yes you could implement a type with configurable minbound if you had Fin
jle` 2017-02-04 13:23:09
erisco: :D
jle` 2017-02-04 13:23:51
erisco: ah yeah i did assume that you knew about fin when you mentioned bounded earlier
zipper 2017-02-04 13:23:52
Hey, how do I escape all the '\' in a string?
jle` 2017-02-04 13:23:59
Fin is nice cause it has a nice inductive definition
zipper 2017-02-04 13:24:03
Like prepend a '\'
jle` 2017-02-04 13:24:11
so you don't have to worry about <= and type families like that
zipper 2017-02-04 13:24:14
Kinda like intersperse
jle` 2017-02-04 13:24:15
zipper: \\ ?
jle` 2017-02-04 13:24:21
oh, all of them?
zipper 2017-02-04 13:24:22
jle`: Yes
jle` 2017-02-04 13:24:35
erisco: http://hackage.haskell.org/package/type-combinators-0.2.4.3/docs/Data-Type-Fin.html
zipper 2017-02-04 13:24:40
Yes escape all the '\' in s a string :)
erisco 2017-02-04 13:25:03
no I was not aware. thanks for the link
jle` 2017-02-04 13:25:13
no problem :)
jle` 2017-02-04 13:26:08
yeah, for say, 'Fin (S (S Z))', there are two inhabitants: 'FZ' and 'FS FZ'
jle` 2017-02-04 13:26:31
and for the type Fin (S (S (S Z)), there are three inhabitants: 'FZ', 'FS (FS FZ)', and 'FS (FS (FS FZ))'
jle` 2017-02-04 13:26:36
um
jle` 2017-02-04 13:26:43
that should have been FZ, FS FZ, and FS (FS FZ)
erisco 2017-02-04 13:27:01
1, 2, skip a few
benzrf 2017-02-04 13:27:29
ok i manually compiled the files with -dynamic-too and now it works
benzrf 2017-02-04 13:27:31
wtf?
zipper 2017-02-04 13:27:45
escape functions are no help :(
EvanR 2017-02-04 13:28:14
replace "\\" "\\\\"
EvanR 2017-02-04 13:28:34
you could also try
EvanR 2017-02-04 13:28:44
> show "a\\bc\\\\d"
lambdabot 2017-02-04 13:28:48
"\"a\\\\bc\\\\\\\\d\""
vektorweg1 2017-02-04 13:29:45
+1
erisco 2017-02-04 13:30:02
surprised not to see the Bounded and Enum instances on Fin
hpc 2017-02-04 13:30:11
> fix show
lambdabot 2017-02-04 13:30:14
"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\...
erisco 2017-02-04 13:30:47
this is my amateurish mess for Enum on BoundedNat http://lpaste.net/352091
benzrf 2017-02-04 13:31:30
> fix (error "broken")
lambdabot 2017-02-04 13:31:32
*Exception: broken
monochrom 2017-02-04 13:31:33
I hate escaping.
benzrf 2017-02-04 13:31:37
oops
benzrf 2017-02-04 13:31:39
> fix error
lambdabot 2017-02-04 13:31:41
"*Exception: *Exception: *Exception: *Exception: *Exception: *Exception: *Ex...
vektorweg1 2017-02-04 13:31:46
loooool
Rembane 2017-02-04 13:32:49
Hilarious!
jle` 2017-02-04 13:33:18
erisco: submit a pr :)
erisco 2017-02-04 13:33:58
climb increments the natural until either i is zero or the successor is equal to the maxBound
hpc 2017-02-04 13:34:05
> take 10 . map length . split (oneOf "\"") $ (fix show)
lambdabot 2017-02-04 13:34:07
[0,1,1,1,3,1,7,1,15,1]
erisco 2017-02-04 13:34:12
took me a while to cobble it together
zipper 2017-02-04 13:34:41
For some reason I can't write an echo function that escapes strings and echoes the exact same thing it got.
hpc 2017-02-04 13:34:43
erp
hpc 2017-02-04 13:34:51
> take 10 . map length . split (dropDelims $ oneOf "\"") $ (fix show)
lambdabot 2017-02-04 13:34:54
[0,1,3,7,15,31,63,127,255,511]
zipper 2017-02-04 13:34:55
Well I can kinda but it fails quickcheck tests
zipper 2017-02-04 13:35:07
For a random string with stuff like \f
zipper 2017-02-04 13:35:09
SMH
zipper 2017-02-04 13:35:34
I can't make it echo x == x in quickcheck
zipper 2017-02-04 13:35:36
hmmmm
benzrf 2017-02-04 13:40:04
i mean... you shouldnt expect that to hold
benzrf 2017-02-04 13:40:26
the whole point is that you want back the escaped version, not the original string, right?
erisco 2017-02-04 13:42:31
jle`, do you usually look for inductive definitions before propositional ones?
jle` 2017-02-04 13:43:34
yes
erisco 2017-02-04 13:43:54
these are usually more concise in use?