`Guest05 2017-02-17 14:51:26
monochrom: how, in interpreter or print in main?
monochrom 2017-02-17 14:52:35
Sorry, what is the context again?
`Guest05 2017-02-17 14:53:56
[06:32:52] Also try this with GHC. x, y :: Int; (x, y) = divMod (y+1, x+2).
`Guest05 2017-02-17 14:53:56
[06:33:13] ghc -O -ddump-prep and see what happens.
mniip 2017-02-17 14:53:57
monochrom, am I looking for Main.x = case ds_r3Ti of _ [Occ=Dead] { }
mniip 2017-02-17 14:54:44
haha, fun: ds_r3Ti = ds_r3Ti
monochrom 2017-02-17 14:57:36
Yes, you should see how all the +1 and +2 and divMod disappear and the generated code just uses the simplest way to express a blackhole or something.
monochrom 2017-02-17 14:57:55
It is very analogous to my C example.
monochrom 2017-02-17 14:58:18
Both compilers decide that I have a semantic infinite loop so why bother.
monochrom 2017-02-17 14:58:53
`Guest05: At your OS's shell's command line.
monochrom 2017-02-17 14:59:36
You will need to put the code in a file and give the filename.
`Guest05 2017-02-17 14:59:36
monochrom: no new information :/
`Guest05 2017-02-17 14:59:36
okay
`Guest05 2017-02-17 15:02:22
hmmm
`Guest05 2017-02-17 15:02:24
i see something
`Guest05 2017-02-17 15:02:32
then:
`Guest05 2017-02-17 15:02:36
realgcc.exe: fatal error: no input files
`Guest05 2017-02-17 15:02:36
compilation terminated.
`Guest05 2017-02-17 15:02:36
`gcc.exe' failed in phase `Assembler'. (Exit code: 1)
`Guest05 2017-02-17 15:02:36
MarcelineVQ 2017-02-17 15:02:51
did you call gcc instead of ghc
`Guest05 2017-02-17 15:02:57
no..
MarcelineVQ 2017-02-17 15:03:03
sounds bad then
`Guest05 2017-02-17 15:03:28
wait... is my ghc doomed?
geekosaur 2017-02-17 15:03:28
dd you put it in a file with a .hs extension?
`Guest05 2017-02-17 15:03:32
yes..
MarcelineVQ 2017-02-17 15:03:57
also " Also try this with GHC. x, y :: Int; (x, y) = divMod (y+1, x+2)." did you mean x, y :: Int; (x, y) = divMod (y+1) (x+2)
`Guest05 2017-02-17 15:04:23
though, it was on other drive, and when i cd'd to it, it worked
EvanR 2017-02-17 15:05:53
spooky side effects of cdihg
EvanR 2017-02-17 15:05:54
cding
monochrom 2017-02-17 15:06:54
Yes MarcelineVQ
`Guest05 2017-02-17 15:11:27
hmm
`Guest05 2017-02-17 15:11:53
will ghc -O remove mapException if inner code hasn't any exceptions?
ezyang 2017-02-17 15:15:08
I don't think so, but it wouldn't be that far fetchedd
MarcelineVQ 2017-02-17 15:23:33
going through my list of tools I'd like to see here, does anyone know of a utility that dumps the defintions you've made in a ghci session to a source file?
suzu 2017-02-17 15:25:46
you could use `script`
suzu 2017-02-17 15:26:00
script makes a typescript of everything displayed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as
suzu 2017-02-17 15:26:02
the typescript file can be printed out later with lpr(1).
suzu 2017-02-17 15:26:04
If the argument file is given, script saves the dialogue in this file. If no filename is given, the dialogue is saved in the file typescript.
geekosaur 2017-02-17 15:26:53
otherwise I don't know of any, and ghci is not especially good at that kind of thing
geekosaur 2017-02-17 15:27:02
might see if ihaskell fits better
MarcelineVQ 2017-02-17 15:27:14
I'm interested in making one but I wanted to make sure it wasn't explored
MarcelineVQ 2017-02-17 15:27:17
suzu: thank you
geekosaur 2017-02-17 15:27:21
there's also trawling the history
geekosaur 2017-02-17 15:27:42
~/.ghc/ghci_history on linux
geekosaur 2017-02-17 15:27:50
and probably os x
suzu 2017-02-17 15:29:42
oh yes ghci_history would be good too
glguy 2017-02-17 15:38:37
`Guest05: Exceptions can come from other threads. It's not possible to know that an exception couldn't occur
`Guest05 2017-02-17 15:39:32
glguy: "code hasn't exceptions" as in "obviously"
`Guest05 2017-02-17 15:39:40
like, 5 :: Int
c_wraith 2017-02-17 15:39:42
until the runtime gets more advanced, you can know that an exception won't happen if a pure computation doesn't allocate. :)
`Guest05 2017-02-17 15:39:53
whoah
`Guest05 2017-02-17 15:39:55
okay.
`Guest05 2017-02-17 15:39:59
allocations.
c_wraith 2017-02-17 15:40:06
(5 :: Int) allocates, at least potentially. :P
`Guest05 2017-02-17 15:40:14
ok you win.
c_wraith 2017-02-17 15:40:33
The optimizer might remove that, though, if it can prove it's used strictly.
glguy 2017-02-17 15:41:20
Code doesn't have to be able to throw exceptions for another thread to throw an exception to it