adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iorivur has joined #ocaml
rgrinberg has joined #ocaml
sailorswift has joined #ocaml
sp0on has joined #ocaml
Algebr has quit [Remote host closed the connection]
<jrslepak> "No implementations provided for the following modules: Cstubs_internals", but I have ctypes installed... I've tried building ctypes manuallt and copying cstubs_internals.cmx to /usr/lib/ocaml and ~/.opam/system/lib/ctypes, but corebuild still can't find it
<jrslepak> *manually
MrScout has quit [Ping timeout: 248 seconds]
<jrslepak> (also, the toplevel doesn't object when I `open Cstubs', but when I try to use anything from it, I get "Error: Reference to undefined global `Cstubs'")
<rgrinberg> when using Lwt_io, is it necesasry to wait on Lwt_io.write to be determined before writing more?
<Drup> rgrinberg: if you care about order
<jrslepak> (`#load "cstubs.cma";;' makes it available at the toplevel, but what do I do to be able to build code with that?)
<rgrinberg> Drup: I see. it's an annoying difference in async's api where Writer.write* always returns unit ://
ollehar has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
<Drup> and it blocks ?
<rgrinberg> it doesn't block
<rgrinberg> it's just atomic b/c all it does is copy to async's queue
<rgrinberg> which may grow
<Drup> I see
<Drup> you could emulate that with Lwt_stream
<Drup> create a stream for each output and map whatever writing you want on it
<Drup> (or rather, iter it)
<rgrinberg> currently cohttp just returns () after every async write
<rgrinberg> which is also ok i guess
ousado has quit [Read error: Connection reset by peer]
ousado has joined #ocaml
mcclurmc has joined #ocaml
swgillespie has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tnguyen has quit [Remote host closed the connection]
toomuchtvrotsurb has quit [Remote host closed the connection]
badkins has quit []
mcclurmc has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 264 seconds]
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
struktured has joined #ocaml
manizzle has quit [Ping timeout: 256 seconds]
toomuchtvrotsurb has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonludlam has quit [Ping timeout: 252 seconds]
systmkor has quit [Remote host closed the connection]
toomuchtvrotsurb has quit [Ping timeout: 264 seconds]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 244 seconds]
iorivur has quit [Ping timeout: 250 seconds]
Tamae has joined #ocaml
jao has quit [Ping timeout: 246 seconds]
Algebr has joined #ocaml
dalastboss has quit [Ping timeout: 246 seconds]
monoprotic is now known as potatoes
potatoes is now known as P0tat0es
P0tat0es is now known as monoprotic
dmh has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 260 seconds]
struktured has quit [Quit: Konversation terminated!]
ygrek_ has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
Tamae has quit [Ping timeout: 244 seconds]
mcclurmc has quit [Ping timeout: 265 seconds]
systmkor has joined #ocaml
tennix has joined #ocaml
tmtwd has joined #ocaml
tmtwd_ has joined #ocaml
tmtwd_ has quit [Client Quit]
ygrek has joined #ocaml
lewis1711 has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
<lewis1711> say I have some data type "tree t = Leaf t | LIst of tree list". is there anyway I can use a pattern matching to assert that some "List xs" has elements that are all of type "Leaf t" ?
AltGr has joined #ocaml
<struk|desk> lewis1711: yeah, you can do something like match t with Leaf x -> ... | List l when List.exists (function (Leaf t) | -> true | _ -> false) l -> ... | ...
<struk|desk> oh sorry not exists
<struk|desk> List.for_all
<struk|desk> but you get the idea
<lewis1711> ohhh, when clauses. I remember them from somewhere else, so ocaml has them too
<lewis1711> great (:
darkf has joined #ocaml
yaewa has joined #ocaml
moei has quit [Ping timeout: 246 seconds]
empyrean has joined #ocaml
<dmbaturin> lewis1711: OCaml and Haskell are the only languages with guarded patterns I remember of, if the somewhere else is not one of them I'd like to know what other languages have it. :)
dmh has joined #ocaml
<dmbaturin> Ah, wait. Erlang may have it too.
<lewis1711> dmbaturin: I remember now: it was racket
<lewis1711> there is a match.scm floating around for vanilla scheme, I can't remember who wrote it, one of the more prolific scheme hackers. it might have it as well
mcclurmc has joined #ocaml
<tennix> Is there anybody writing OCaml on Mac? I couldn't install ocamlfind with opam
<dmbaturin> Ah, interesting.
<dmbaturin> lewis1711: There's an algebraic types library for chicken scheme.
sp0on has quit [Ping timeout: 240 seconds]
<dmbaturin> tennix: I don't, but many people do, so it's odd. What's the error?
<tennix> It complains 'm4' not found
<tennix> but actually 'm4' is in /usr/bin/m4
<tennix> I even tried gnu m4
<tennix> but still failed
<struk|desk> tennix: how did u install m4? brew? osomething erlse?
<tennix> m4 is mac builtin command
<lewis1711> dmbaturin: can you paste the exact error to some pasting site?
<lewis1711> sorry
<tennix> while my gnu m4 is installed by brew
<lewis1711> tennix: ^
<struk|desk> tennix: make sure your path is right? I had success with a friend's mac after running this brew command (gsl is not necessary for you): https://github.com/struktured/ocaml-bootstrap/blob/master/bin/install-system/install-brew-deps.sh#L2
<tennix> yes, i use zsh and set path and config env as opam init told me
<tennix> In fact i can install ocamlfind with sudo
sp0on has joined #ocaml
BitPuffin|osx has joined #ocaml
manizzle has joined #ocaml
lewis1711 has quit [Ping timeout: 246 seconds]
<tennix> i find nearly every library needs ocamlfind, even core library
<dmbaturin> tennix: Did you try opam -v? Maybe it will show some more details.
lewis1711 has joined #ocaml
<tennix> Oh, i just installed pkg-config and ocamlfind can be installed successfully
<tennix> and i also upgraded camlp4 and now can't install other libraries
<tennix> this time `Package camlp4 not found`
<struk|desk> did u install calmp4 with opam ?
<tennix> using homebrew
nicoo has quit [Ping timeout: 264 seconds]
<struk|desk> tennix: no no
<struk|desk> install calmp4 with opam
<lewis1711> tennix: I think you have to install everything with opam for it to function properly. it's a bit brittle
<struk|desk> *camlp4
<struk|desk> basically install everything with opam except native dependencies
<struk|desk> and even then, you can using opam depext, or whatever
<tennix> Ok, i uninstalled camlp4 from brew and removed ~/.opam and re-init opam
<dmbaturin> If you are using opam, it's better to use opam exclusively (same holds for system package managers).
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 260 seconds]
<tennix> sys/timerfd.h not found, seems that couldn't compile with clang
<struk|desk> eh without a mac hard to help you at this point...thats an error with core though right? not camlp4
tmtwd has quit [Remote host closed the connection]
matason has joined #ocaml
<tennix> I heard nearly everybody says that mac has nice UI as easy as windows and unix utilities as powerful as linux, but now i really miss my archlinux. With mac, there's so many problems with open source softwares
<dmh> surprises me to hear
<struk|desk> most people have little trouble with ocaml + macos
<lewis1711> tennix: archlinux was way too complex for me. I gave up after spending hours trying to get a backlight working. I must make sure to avoid macs then :D
<struk|desk> but I use (k)ubuntu, and ocaml definitely works great with it. same with redhat
<tennix> I used linux nearly 4 years, and just switched to mac for about a month
tmtwd has joined #ocaml
<dmh> "The link for OCPWin has been removed due to an issue waiting to be solved." does anyone have any idea on the status of this
<tennix> camlp4 has to be installed by system package manager as opam says
lewis1711 has quit [Quit: Page closed]
<struk|desk> tennix: really? weird
<tennix> in fact there's no opam package named camlp4
<tennix> opam suggests to install camlp4 by apt-get or yum
yaewa has quit [Quit: Leaving...]
moei has joined #ocaml
<dmh> nevermind, got it going on a mips machine
manizzle has quit [Ping timeout: 264 seconds]
<tennix> Ok, i'll give it up and just using vagrant instead
tmtwd has quit [Remote host closed the connection]
manud has quit [Ping timeout: 244 seconds]
MrScout has joined #ocaml
<dmbaturin> tennix: Personally I find OS X UI, especially post 10.6, absolutely unusable. :)
<dmbaturin> Opinions vary, of course.
mcclurmc_ has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
dmh- has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mankyKitty_ has joined #ocaml
struk|desk2 has joined #ocaml
dmh has quit [Ping timeout: 248 seconds]
n1ftyn8__ has joined #ocaml
dmh- is now known as dmh
rwmjones_ has joined #ocaml
igitoor_ has joined #ocaml
theblatt1 has joined #ocaml
empyreanx has joined #ocaml
mietek_ has joined #ocaml
mankyKitty has quit [Ping timeout: 252 seconds]
n1ftyn8_ has quit [Ping timeout: 252 seconds]
mietek has quit [Ping timeout: 252 seconds]
bbc has quit [Ping timeout: 252 seconds]
Sorella has quit [Ping timeout: 252 seconds]
ericbmerritt has quit [Ping timeout: 252 seconds]
struk|desk has quit [Ping timeout: 252 seconds]
empyrean has quit [Ping timeout: 252 seconds]
rfv has quit [Ping timeout: 252 seconds]
andreypopp_ has quit [Ping timeout: 252 seconds]
bbc has joined #ocaml
ericbmerritt has joined #ocaml
theblatte has quit [Ping timeout: 252 seconds]
igitoor has quit [Ping timeout: 252 seconds]
noplamodo has quit [Ping timeout: 252 seconds]
rwmjones has quit [Ping timeout: 252 seconds]
bobpoekert has quit [Ping timeout: 252 seconds]
ericbmerritt has joined #ocaml
ericbmerritt has quit [Changing host]
rfv_ has joined #ocaml
mankyKitty_ is now known as mankyKitty
mcclurmc has joined #ocaml
n1ftyn8__ is now known as n1ftyn8_
Sorella has joined #ocaml
noplamodo has joined #ocaml
bobpoekert has joined #ocaml
swgillespie has joined #ocaml
andreypopp_ has joined #ocaml
igitoor_ has joined #ocaml
igitoor_ has quit [Changing host]
igitoor_ is now known as igitoor
tmtwd has joined #ocaml
tmtwd has quit [Read error: Connection reset by peer]
tmtwd has joined #ocaml
ollehar1 has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tennix> I came from linux, so quit not comfortable with OSX UI these days
<tennix> But i have to use mac for work
<tennix> I found Rust borrowed a lot of things from OCaml after read RWO
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
MrScout has quit [Remote host closed the connection]
obadz has quit [Ping timeout: 255 seconds]
obadz has joined #ocaml
<ollehar1> is there an extension to ocaml that allows type-level computations? like simply-typed lambda calc?
<ollehar1> tennix: Rust was implemented in ocaml at first.
Kakadu has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tnguyen has joined #ocaml
<tennix> yes, many interpreter and compiler were implemented in ocaml first. So i decided to learn it
<ollehar1> tennix: good choice :)
theblatt1 has quit [Ping timeout: 265 seconds]
theblatte has joined #ocaml
darkf has quit [Quit: Leaving]
darkf has joined #ocaml
matason has quit [Ping timeout: 265 seconds]
rfv_ is now known as rfv
tmtwd has quit [Remote host closed the connection]
DanielRichman has quit [Quit: leaving]
DanielRichman has joined #ocaml
DanielRichman has quit [Quit: leaving]
DanielRichman has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 256 seconds]
ollehar1 has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
keen__________23 has joined #ocaml
keen__________22 has quit [Ping timeout: 244 seconds]
Submarine has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
matason has joined #ocaml
sh0t has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
kaustuv has joined #ocaml
malc_ has joined #ocaml
mcclurmc has joined #ocaml
<kaustuv> How do I read files using js_of_ocaml? For example: http://pastebin.com/q1ntYiF7
matason has quit [Ping timeout: 255 seconds]
matason has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
siddharthv_away is now known as siddharthv
haesbaer1 has quit [Quit: leaving]
haesbaert has joined #ocaml
nicoo has joined #ocaml
siddharthv is now known as siddharthv_away
kushal has quit [Quit: Leaving]
BitPuffin|osx has quit [Ping timeout: 264 seconds]
empyreanx has quit [Ping timeout: 250 seconds]
empyreanx has joined #ocaml
voglerr has joined #ocaml
kaustuv has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
yomimono has joined #ocaml
matason has quit [Quit: matason]
Kakadu has quit [Remote host closed the connection]
lewis1711 has joined #ocaml
boegel|afk has quit [Quit: No Ping reply in 180 seconds.]
AltGr has quit [Ping timeout: 246 seconds]
boegel has joined #ocaml
matason has joined #ocaml
manud has joined #ocaml
kushal has joined #ocaml
mcclurmc has joined #ocaml
mort___ has joined #ocaml
kushal has quit [Client Quit]
mcclurmc has quit [Ping timeout: 240 seconds]
creichert has quit [Ping timeout: 244 seconds]
jonludlam has joined #ocaml
Hannibal_Smith has joined #ocaml
kushal has joined #ocaml
octachron has joined #ocaml
grouzen has quit [Ping timeout: 252 seconds]
<ollehar> about type-inference for php: since classes can be fully annotated, would it be sinsible to divide the type-inferring phase into two: first type-check, and then type-infer?
<ollehar> *annotated = hinted
QuanticPotato has joined #ocaml
rwmjones_ is now known as rwmjones
matason has quit [Ping timeout: 244 seconds]
yomimono has quit [Ping timeout: 255 seconds]
QuanticPotato has quit [Ping timeout: 240 seconds]
QuanticPotato has joined #ocaml
mcclurmc has joined #ocaml
matason has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
whirm1 has joined #ocaml
matason has quit [Ping timeout: 246 seconds]
sailorswift has joined #ocaml
yomimono has joined #ocaml
manud has quit [Quit: manud]
grouzen has joined #ocaml
<grouzen> hi, I'm new to OCaml. I wanna ask about tools for getting information about types, modules, etc. I'm using emacs with tuareg-mode, can't find any useful information in google ;(
<bernardofpc> use merlin
manud has joined #ocaml
<bernardofpc> the simple way (if you already have opam) is to "opam install merlin"
<bernardofpc> otherwise, more details @ https://github.com/the-lambda-church/merlin
matason has joined #ocaml
<grouzen> thanks, will look at it.
_andre has joined #ocaml
TheLemonMan has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
QuanticPotato has quit [Ping timeout: 255 seconds]
<grouzen> rks`: thank you
QuanticPotato has joined #ocaml
<bernardofpc> struk|desk2: struk|work I've read http://code.activestate.com/recipes/393090/ and coded msum in OCaml
<bernardofpc> not sure this is needed for stats (maybe we don't care about exact to mach_eps results anyway!), but here it is :
<companion_cube> there's something like this in batteries, I think
<companion_cube> funny, you write abs_float(x)
<companion_cube> instead of abs_float x
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mcclurmc has joined #ocaml
<bernardofpc> cp/paste from python explains all :D
Haudegen has joined #ocaml
<bernardofpc> companion_cube: I see kahan summation in Batteries, not full-precision summation
mcclurmc has quit [Ping timeout: 246 seconds]
yomimono has quit [Quit: Leaving]
<bernardofpc> the difference only appears if there are wildly different ranges
<bernardofpc> for instance: [1e1; 1e100; 1e1; -1e100] ;;
<bernardofpc> kahan will sum to zero (since it cancles more than 2*53 bits), while msum will give 20.
<companion_cube> oh
<companion_cube> I don't even want to know
accidus has joined #ocaml
<bernardofpc> :(
<bernardofpc> it's such a simple example
QuanticPotato has quit [Quit: Leaving]
ggole has joined #ocaml
zpe has quit [Remote host closed the connection]
manud has quit [Quit: manud]
jabesed has joined #ocaml
zpe has joined #ocaml
mort___ has quit [Read error: Connection reset by peer]
mort___ has joined #ocaml
<reynir> I'm looking at ocaml-x509. It seems X509.CA.sign ignores any extensions in the csr. Is this a bug or feature? :o
<reynir> (sorry, might be a bit off-topic)
<flux> I guess best avenues for the answer: 1) source code 2) author :-)
obadz has quit [Ping timeout: 255 seconds]
obadz has joined #ocaml
<reynir> Yea, I checked the source. I guess I'll make an issue on github
tennix has quit [Remote host closed the connection]
<grouzen> also, I was trying to find how to determine if end-of-file occurs, I found only the only one way to do it using exceptions
<grouzen> is there other way?
<flux> grouzen, that's the way with ocaml standard library
<grouzen> so, it's "ok"?
<flux> grouzen, yes
<grouzen> cool
<flux> grouzen, btw, are you aware of the uniform pattern matching & exception matching syntax?
<ollehar> (btw, is pattern-matching syntactic sugar?)
Kakadu has joined #ocaml
<grouzen> flux: sure
<flux> ollehar, no
<ollehar> flux: ok
<flux> ollehar, one variant related to is, though: function
mcclurmc has joined #ocaml
<grouzen> I have fp background, just can't find information for ocaml how to do simple things (%
<ollehar> yeah
<flux> well I suppose you could think that 'fun' is syntactic candy for 'fun' as well :)
<grouzen> that's why I'm here
<ollehar> flux: you wrote 'fun' twice. you mean 'let'?
<flux> grouzen, well, you should look into some libraries in addition to the standard library for actually achieving real-world things.. :)
<flux> ollehar, oops, I meant "for 'function'"
<grouzen> and, I found that realworldocaml.org is down, at least for now
<flux> fun a b c -> a + b + c could become function a -> function b -> function c -> a + b + c
<ollehar> grouzen: not for me :P
mcclurmc has quit [Ping timeout: 246 seconds]
<grouzen> flux: yeah. I just wanna try the language using some standard 'hello world' examples using I/O, etc
<grouzen> ollehar: wow, it's working now ;]
<grouzen> thanks guys
kushal has quit [Quit: Leaving]
whirm1 has quit [Quit: WeeChat 1.2]
lewis1711 has quit [Ping timeout: 244 seconds]
<dmbaturin> grouzen: realworldocaml.org works for me.
<dmbaturin> Also, I guess the canonical examples for ML should be an expression interpreter, a pattern matcher, and a type checker. :)
tmtwd has joined #ocaml
tashjash has joined #ocaml
hay207 has joined #ocaml
Denommus has joined #ocaml
rgrinberg has joined #ocaml
mcclurmc has joined #ocaml
NingaLea_ has joined #ocaml
NingaLea_ has quit [Client Quit]
NingaLeaf has joined #ocaml
mcclurmc has quit [Ping timeout: 248 seconds]
Haudegen has quit [Remote host closed the connection]
rossberg has quit [Ping timeout: 248 seconds]
Hannibal_Smith has quit [Quit: Leaving]
Haudegen has joined #ocaml
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
<ollehar> dmbaturin: did you see that blog engine done and proved in coq?
NingaLeaf has quit []
Haudegen has quit [Ping timeout: 264 seconds]
SkNix has joined #ocaml
rossberg has joined #ocaml
Denommus has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
tennix has joined #ocaml
tennix has quit [Remote host closed the connection]
dhil has joined #ocaml
yomimono has joined #ocaml
badkins has joined #ocaml
shinnya has joined #ocaml
ollehar has quit [Ping timeout: 244 seconds]
mcclurmc has joined #ocaml
ollehar has joined #ocaml
mcclurmc has quit [Ping timeout: 264 seconds]
ollehar has quit [Client Quit]
kushal has joined #ocaml
mietek_ is now known as mietek
Denommus has joined #ocaml
toomuchtvrotsurb has joined #ocaml
dvb_ua has joined #ocaml
BitPuffin|osx has joined #ocaml
jabesed has quit [Ping timeout: 244 seconds]
rand000 has joined #ocaml
sh0t has quit [Ping timeout: 252 seconds]
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
sepp2k has joined #ocaml
voglerr has quit [Remote host closed the connection]
walter|r has joined #ocaml
jabesed has joined #ocaml
walter|r has quit [Remote host closed the connection]
ollehar has joined #ocaml
mcclurmc has joined #ocaml
nullcat_ has joined #ocaml
Akshay has joined #ocaml
<nullcat_> i have to do this
toomuchtvrotsurb has quit [Remote host closed the connection]
mcclurmc has quit [Ping timeout: 246 seconds]
Kakadu has quit [Quit: Page closed]
creichert has joined #ocaml
badkins has quit [Read error: Connection reset by peer]
madroach has quit [Ping timeout: 264 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
jtfmumm has joined #ocaml
<dmbaturin> ollehar: Yeah, I think I've seen that but didn't delve into the proofs.
<ollehar> dmbaturin: just regarding typical excersices
madroach has joined #ocaml
grouzen has quit [Ping timeout: 244 seconds]
Hannibal_Smith has joined #ocaml
tane has joined #ocaml
zpe has quit [Remote host closed the connection]
<dmbaturin> nullcat_: Maybe an actual Obj manual is worth writing. ;)
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
octachron has quit [Quit: Leaving]
jao has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
mcclurmc has joined #ocaml
bitemyapp has quit [Ping timeout: 244 seconds]
badkins has joined #ocaml
mcclurmc has quit [Read error: Connection reset by peer]
grouzen has joined #ocaml
tashjash has quit [Quit: Leaving]
sailorswift has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
MrScout has joined #ocaml
<Drup> rgrinberg: where did you discovered batyr ? it seems not recent at all and I never heard of it! :O
rgrinberg has quit [Quit: WeeChat 1.2]
Haudegen has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
<smondet> Drup: the guy how talked about ocaml-caqti on the ML, I went though the rest of his github account and starred a bunch of stuff
<smondet> including that project
obadz has quit [Ping timeout: 244 seconds]
obadz has joined #ocaml
<flux> starred github projects.. "I'll check this one out when I have more time for it" ie. never.. ;-)
badkins_ has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
ygrek has joined #ocaml
toomuchtvrotsurb has joined #ocaml
mcclurmc has joined #ocaml
badkins has quit [Ping timeout: 244 seconds]
Algebr has quit [Remote host closed the connection]
mcclurmc has quit [Read error: Connection reset by peer]
psy_ has quit [Ping timeout: 256 seconds]
sailorswift has quit [Max SendQ exceeded]
sailorswift has joined #ocaml
jonludlam has quit [Ping timeout: 240 seconds]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
steshaw has quit [Ping timeout: 246 seconds]
psy_ has joined #ocaml
steshaw has joined #ocaml
tane has quit [Ping timeout: 265 seconds]
nullcat__ has joined #ocaml
tane has joined #ocaml
nullcat_ has quit [Ping timeout: 256 seconds]
antegallya has joined #ocaml
mort___ has quit [Ping timeout: 246 seconds]
antegallya has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
swgillespie has joined #ocaml
badkins has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
badkins_ has quit [Ping timeout: 244 seconds]
lobo has joined #ocaml
nullcat__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sailorswift has quit [Remote host closed the connection]
mort___ has joined #ocaml
Kakadu has joined #ocaml
ggole has quit []
sailorswift has joined #ocaml
sailorswift has quit [Max SendQ exceeded]
sailorswift has joined #ocaml
<apache2> yah
<apache2> but easier to search
Akshay has quit [Quit: Leaving]
elfring has joined #ocaml
<Drup> flux: I actually star only to find back something
swgillespie has quit [Quit: Textual IRC Client: www.textualapp.com]
dmh has quit [Quit: Leaving]
tane has quit [Ping timeout: 240 seconds]
physixer has joined #ocaml
<physixer> what does 'lec rec x = ...' mean when ... doesn't begin with 'fun' ? it looks like it's binding to a literal not a lambda but then what does a 'recursive literal' mean?
<physixer> e.g., let rec x = 5?
<companion_cube> let rec l = 1 :: 2 :: l
<flux> hmm, I may be keeping a short presentation on OCaml during the fall, I should embed the RWO w/ Obj.Magic-picture there..
<physixer> companion_cube: but what 'l' is originally? to which literal '1' and literal '2' are being prepended?
<physixer> or are you saying this is valid:
darkf has quit [Quit: Leaving]
<physixer> let l = [3;4;5]
<physixer> let rec l = 1 :: 2 :: l
<flux> it's valid but the first line is completely superfluous
<flux> let rec x = expr means x is bound within expr
<flux> to that particular definition
<flux> that 1::2::l works is just an extension, I don't think it's generally applicaple
<physixer> flux: if we have the first line, then we have final l as [1;2;3;4;5]. Without it, how what does 'l' mean and how do we use it?
Algebr has joined #ocaml
<flux> but just yesterday or so I wrote something like: let rec commands = [{command = list_commands (lazy commands) }]
<flux> physixer, did you try these commands in toplevel?
<physixer> flux: nope
<flux> well, you should ;)
<companion_cube> physixer: this is an infinite list, 1 :: 2 :: 1 :: 2 :: 1 :: 2 :: ...
<physixer> companion_cube: yes but then it's non terminating?
<Drup> indeed it is
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
<flux> it's quite difficult to make infinite concrete types in ocaml
mcclurmc has joined #ocaml
tane has joined #ocaml
<flux> without mutable intermediate values or unsafe casting that is
<flux> that's probably the only one :)
<physixer> then back to my original question, 'lec rec' is only useful if it's applied to a function, not a literal?
<flux> physixer, by literal you mean a value that's not a function?
<flux> physixer, but no, I just have you an example of such an use
toomuchtvrotsurb has quit [Ping timeout: 264 seconds]
<physixer> flux: by literal I mean anything other than a function (int, list, immutable, mutable data structure) etc
<physixer> maybe I'm misusing the term 'literal'
elfring has quit [Quit: Konversation terminated!]
<Drup> "literal" usually means things like 1, "bla", [] ..
<Drup> things that are pure data and don't involve the call of a funciton
<companion_cube> it can be useful for records
<companion_cube> sometimes
toomuchtvrotsurb has joined #ocaml
<flux> much like my example, where you add functions into a record that get a reference to said record
jwatzman|work has joined #ocaml
<flux> actually using lazy was not required there, but it would have required then a lambda function
<jrslepak> "Error: Files /home/jslepak/.opam/system/lib/ctypes/ctypes.cmxa and /home/jslepak/.opam/system/lib/ctypes/ctypes.cmxa both define a module named Ctypes_common" -- I wonder what other modules they both define...
<Drup> jrslepak: first guess, you tried to link something twice.
<jrslepak> yeaj
<jrslepak> *yeah
physixer has quit [Quit: leaving]
mort___ has quit [Quit: Leaving.]
7GHAAQPV6 has joined #ocaml
jonludlam has joined #ocaml
Asmadeus has quit [Ping timeout: 255 seconds]
Asmadeus has joined #ocaml
xavierm02 has joined #ocaml
jabesed has quit [Ping timeout: 244 seconds]
<xavierm02> Hi. I'm trying to implement finite functions efficiently (for example with hashmaps) in a polymorphic way (with respect to the input, the output, and the way it is implemented).
shinnya has joined #ocaml
<xavierm02> I kind of did it by making them carry an "implementation" record with them containing all the functions it needs to change a value / apply itself and so on. But now I'm having trouble uncurrying functions because when I have a function A->B->C, I don't have access to the implementation of B->C (I can't have a function to get it in the implementation because it wouldn't make sence in the case A->D where D isn't a function type).
<xavierm02> So I'm kind of stuck because of the one case where I need to initialize an element of type B->C in order to add a value to a function A->B->C. Anyway, here's the whole thing: http://pastebin.com/RbchCsQi Thank you in advance for your help :)
tane has quit [Ping timeout: 256 seconds]
empyreanx has left #ocaml ["Leaving"]
<ollehar> a statement should always unify to unit, right?
<ollehar> (type-inferring)
jabesed has joined #ocaml
<companion_cube> in a; b there is not need for a to have type unit
<companion_cube> but it can emit a warning if a is not of type unit, if you wish so
<flux> statements don't have types..
<companion_cube> there are no statements in OCaml... unless you mean toplevel let-definitions
<flux> they are basically statements, no?
<ollehar> I'm working in PHP, though
<Drup> ollehar: it's a choice. I would advise for a warning in case it is not
<flux> apparently ocaml calls also 'open' a definition in its language definition
<ollehar> hacklang converts this:
<ollehar> $a = 10;
<ollehar> into this ast:
<ollehar> [(Ast.Stmt
<ollehar> (Ast.Expr
<ollehar> (<opaque>,
<ollehar> Ast.Binop ((Ast.Eq None), (<opaque>, (Ast.Lvar (<opaque>, "$a"))),
<ollehar> (<opaque>, (Ast.Int (<opaque>, "10")))))))]
<flux> I was thinking along the lines "what's a top-level concept that includes both definitions and opens" :)
<ollehar> (where <opaque> is me being lazy with derivate)
bitbckt has quit [K-Lined]
<reynir> Hi
bitbckt has joined #ocaml
<jwatzman|work> ollehar: in Hack, no, statements do not always have type unit, since expressions can be promoted to statements (Ast.Stmt Ast.Expr in your example)
Algebr has quit [Remote host closed the connection]
<Drup> xavierm02: I think your "curried_t" is just wrong
<jwatzman|work> ollehar: for example, if function f returns an int, I'm allowed to just do f(); as a statement and ignore the return value, as in most languages
<Drup> basically, you did (input1 -> input2) -> output
<ollehar> jwatzman|work: ah, but I will enforce NOT using f() as statement if it returns int
<Drup> a curried function is input1 -> (input2 -> output)
<ollehar> that's the point with my project
<ollehar> or, one of the points.
<jwatzman|work> ollehar: if you're doing your own thing, that is of course up to you :) I misunderstood your statement as a question about Hack itself
<ollehar> ah, no. I'm just using the hack parser/lexer. I'm making my own type-inference.
<Drup> xavierm02: also, I'm quite amazed at how verbose you can make your names
MrScout has quit [Ping timeout: 248 seconds]
<Drup> It's kind of an achievement, at this point
jabesed has quit [Ping timeout: 244 seconds]
jabesed has joined #ocaml
<xavierm02> Drup: I don't see how it is wrong. I managed to type the uncurry function with the expected type (after removing the 'make_argument that added problems that I don't want to deal with yet). http://pastebin.com/XwY2hZsx
<xavierm02> Drup: let uncurry (f : ('outer_input, 'inner_input -> 'output, 'datatype) curried_t) : ('outer_input * 'inner_input, 'output, 'datatype) t
<xavierm02> Drup: Maybe my names for the type parameters are to blade. 'output isn't the same thing in both types
<Drup> xavierm02: hum, somehow I read the constraint on input instead of output ...
<Drup> xavierm02: you are aware your scheme doesn't work for composition, right ?
<xavierm02> :o
<Drup> because of the set function.
<xavierm02> no
<Drup> imagine you have 'a -> 'b and 'b -> 'c
<Drup> you compose, you got 'a -> 'c
<Drup> and then you want to set on that
<Drup> the interface means you have to give something of type 'a and something of type 'c
<Drup> but nothing of type 'b
<Drup> so you can't set the middle part
<Drup> (the rest works fine)
<Drup> unset might be unsound, though
<Drup> well, either unsound, leaking, or expansive, pick one :D
<xavierm02> I guess I need something to iter on the elements of the domain for which the function is defined
<xavierm02> that looks like it would fix composition
<Drup> not really
<Drup> how do you produce the middle element ?
<xavierm02> in a way, the idea behind those implementations is to build a new map every time you do an operation
<Drup> hum, wait a sec
<Drup> there is a way which works only on polymorphic map, and polymorphic maps are evil
<Drup> ooh, no, I'm an idiot
swgillespie has joined #ocaml
<xavierm02> for a in (f : A -> B), if f a = Some b then (add (g b) in h)
<xavierm02> where g : B->C and h :A->C
<Drup> yeah
<xavierm02> the thing is that everything should work if you compute
<Drup> it means that composition is expansive
<Drup> which is unnatural
<xavierm02> yes, but then application isn't
<Drup> yes
<xavierm02> but I dont want to compute for the uncurry, I want it to act as some kind of proxy
<xavierm02> which is why it's even weirder
<Drup> I'm not even sure why you want uncurry to begin with :p
<xavierm02> I guess there's just no reason for the proxy to behave like the normal type :o
<xavierm02> I'm guna play with automaton. So I have delta : state -> symbol -> state. And when I read a symbol, I don't want to have to do the intermediary match to see if I get a None aafter the first application or if I get a Some and do the second application. So I want to apply the uncurried version to (q, s) directly :)
<xavierm02> state -> symbol -> state set* but it doesn't change anything
<Drup> I don't see your thing being beneficial for that, but ok
<xavierm02> let's say you want to represent AxBxC as a *partial* function A->B->C set. To test if an element is in it, you apply the function of type (A->B->C) to its first component, if the result if not None, you then apply the result of type B->C to the second component...
<xavierm02> So then if you have A->B->C->D->E, you need to have something like 4 nested matches because you can hit none at any point
<Drup> No, I mean, I don't think your implementation of partial functions being beneficial for automatons.
<xavierm02> whereas wit uncurry, you can transform it to A*B*C*D->E and only have one match
<xavierm02> You mean they won't be convenient or won't be performant?
<Drup> you should work on automatons directly, not try to go through partial functions
<Drup> both
_andre has quit [Quit: leaving]
<xavierm02> I'm building the automatons
<xavierm02> so I need something to represent the transitions
<xavierm02> I started with PMaps of MultiPMaps and it got ugly
<xavierm02> so I decided to work on so abstract "finite function" thing and then come back to automaton later
<xavierm02> Drup: By the way, all I really need is an automata library that allows checking for emptyness, complementation and the usual operations
<xavierm02> and I couldn't find one so I'm building it
<Drup> xavierm02: implement equivalence of automaton for Re ;)
<Drup> (that actually would be really interesting)
<xavierm02> what does that mean :o
<Drup> if you add an equivalent relation over regexp, you could do what you want
<Drup> and you would get efficiency.
<Drup> wait, do you need inclusion or only test for emptyness ?
<Drup> (ok, arguably that's the same)
<xavierm02> I want to do a makefile that can have several placeholders (like%) and can check that no ambiguity cna arise
<xavierm02> so emptyness of intersection is all I really need
<xavierm02> but complementation would be great too, and not just at the word level like most regex allow it
<Drup> heh, since when makefiles are representable as FSA ?
<xavierm02> I lean
<xavierm02> the language described by the patterns before the :
<xavierm02> mean*
<xavierm02> makefiles match your goal with the language of things each rule can build
<ollehar> when you have a hierachal ast tree, then you need more than one unify function?
<ollehar> like, unify_stmt, unify_expr...
<Drup> ollehar: unify works on type
<Drup> not on expressions/statements/whatever
<flux> (fsa is another name for fsm?)
<Drup> flux: yes
<flux> a for accepter?
<Drup> automaton
<flux> ah, of course :)
<Drup> xavierm02: I see, ok
Haudegen has quit [Ping timeout: 240 seconds]
<xavierm02> so should I look more into that ocaml-re thing? Or is my goal too far from what it does?
<ollehar> but expr_ =
<ollehar> Array of afield list
<ollehar> | Binop of bop
<ollehar> and then
<ollehar> bop =
<ollehar> Plus
<ollehar> | Times
<ollehar> | Eq ...
<ollehar> so I need one unify_expr and another for unify_bop?
<flux> btw, here's a script I sometimes use for pasting stuff to irc.. :) xsel | tr '\t' ' ' | tr '\n' ' ' | sed 's/ */ /g' | xsel -i
<Drup> here is a script I seomtimes use for pasting stuff to irc : http://bpaste.net/
<Drup> :3
<ollehar> right :)
<flux> well, if it's long, but then you need to open it :)
<Drup> flux: I do have a script which sends it without opening it
<Drup> xavierm02: re's automaton representation is very specific, and probably completely impossible to inspect
<flux> well that's only what you do, but there are 270 recipients!
jao has quit [Ping timeout: 250 seconds]
<flux> 269 clicks!
<Drup> you can take a look, it's interesting
dvb_ua has quit [Ping timeout: 244 seconds]
ygrek has quit [Ping timeout: 240 seconds]
SkNix has quit [Quit: Saindo]
<flux> someone(TM) should also add the ability to travel the tree (randomly, depth first, breadth first, other criteria) and generate examples of matched strings!
<flux> I mean fsa, not tree
<Drup> flux: look at re's automaton implementation
<Drup> you will quickly understand why that may not be so simple;
Haudegen has joined #ocaml
matason has quit [Ping timeout: 248 seconds]
toomuchtvrotsurb has quit [Remote host closed the connection]
Anarchos has joined #ocaml
<xavierm02> ocaml_re actually has complementation in the expression type but when it's matched it's sent to an assert false :(
Anarchos has quit [Read error: Connection reset by peer]
<Drup> it's desugared/propagate through the regexp
7GHAAQPV6 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
badkins has quit []
malc_ has quit [Quit: leaving]
<xavierm02> Yes, but only for simple subexpressions
<xavierm02> from what I've understood
<Drup> yes
<xavierm02> anyway, thank you for your help and good night :)
hay207 has quit [Ping timeout: 246 seconds]
xavierm02 has quit [Quit: Page closed]
Kakadu has quit [Remote host closed the connection]
ygrek has joined #ocaml
hay207 has joined #ocaml
sh0t has quit [Ping timeout: 255 seconds]
kawaii-imouto is now known as pyon
badkins has joined #ocaml
walter|r has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 244 seconds]
sh0t has joined #ocaml
grouzen has quit [Ping timeout: 240 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sepp2k has quit [Quit: Leaving.]
swgillespie has joined #ocaml
sp0on has quit [Ping timeout: 240 seconds]
Hannibal_Smith has quit [Quit: Leaving]
lewis1711 has joined #ocaml
pyon is now known as kawaii-imouto
lobo has quit [Quit: leaving]
Denommus has quit [Quit: going home]
sh0t has quit [Remote host closed the connection]
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
jabesed has quit [Ping timeout: 265 seconds]
rand000 has quit [Quit: Lost terminal]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
MrScout has joined #ocaml
smtb_ has joined #ocaml
MrScout has quit [Read error: Connection reset by peer]
MrScout has joined #ocaml
mcclurmc has quit []
blandflakes has joined #ocaml
swgillespie has joined #ocaml
mcclurmc has joined #ocaml