tennix has quit [Remote host closed the connection]
thizanne has quit [Ping timeout: 265 seconds]
silver has quit [Quit: rakede]
fraggle_ has quit [Ping timeout: 260 seconds]
mhsjlw has joined #ocaml
<mhsjlw>
Hi! I need to write some int8, int16 as big-endian varying signed and unsigned to a socket
<mhsjlw>
I was looking at Core's Bigstring
<mhsjlw>
would it do what I want, or is there something else?
chsn has quit [Quit: leaving]
fraggle_ has joined #ocaml
mhsjlw has quit [Ping timeout: 264 seconds]
<copy`>
mhsjlw: There's ocplib-endian if you want something lighter
shinnya has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
pierpa has quit [Ping timeout: 250 seconds]
adelbertc has quit [Quit: Connection closed for inactivity]
shinnya has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #ocaml
struk|desk has quit [Read error: Connection reset by peer]
tmtwd has joined #ocaml
manizzle has quit [Ping timeout: 252 seconds]
Heasummn has quit [Ping timeout: 250 seconds]
chsn has joined #ocaml
<chsn>
is it true that there is two ways to do everything in OCaml? the old way and the JaneStreet way and the two don't mix?
minn has joined #ocaml
<minn>
I'm looking through the standard library, but not seeing anything equivalent to Haskell's foldr1/foldl1. Am I missing something, or out of luck?
<chsn>
minn: hasekellers unite!
<chsn>
minn: I'm here just because bucklescript looks easier than ghcjs
<chsn>
minn: what brigs you here?
<Khady>
I don't think there is one minn
<Khady>
chsn: janestreet uses a few different librairies than most of the other companies, but this is not a separate path. You can use Core and Lwt in the same codebase without problem
axiles has quit [Ping timeout: 255 seconds]
axiles has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<minn>
chsn: Haskell solidarity! I'm here because my compilers class uses OCaml :)
<minn>
Khady: Yeah, the Jane Street library is really nice. Thanks, though :)
<minn>
chsn: Missing higher-kinded polymorphism. Getting used to modules. Such is life, I guess.
eikke has quit [Ping timeout: 252 seconds]
eikke has joined #ocaml
<chsn>
minn: a haskeller in an compiler course; looks like that curve is getting wrecked
soupault has joined #ocaml
rgrinberg has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #ocaml
<minn>
chsn: I wish me luck too
FreeBirdLjj has quit [Ping timeout: 250 seconds]
tmtwd has quit [Ping timeout: 265 seconds]
nicholasf has quit [Remote host closed the connection]
teiresias has quit [Quit: Leaving.]
teiresias has joined #ocaml
<suppi>
Hi everyone :) I have a bit of a weird question
Algebr`` has quit [Read error: Connection reset by peer]
<suppi>
I've heard of OCaml but never really tried to learn it because i didn't find the motivation to
<suppi>
what i'm trying to ask is, as a haskeller, what reasons/motivation might i have to learn OCaml as well?
<soupault>
suppi: the only motivation you can get is a pleasure of writing code in OCaml. start with RealWorldOCaml book (it is pretty dense and short) and you will get an idea if it is for you or not
nicholasf has joined #ocaml
<soupault>
I mean, there is not much about hype and jobs in OCaml, so your motivation has to be self-based mostly
<suppi>
how different is it from haskell? what benefits would i get over it?
<suppi>
soupault: thanks for the recommendation, i've skimmed it a little and it looks like a good book
<suppi>
through it°
<soupault>
I'm not really familiar with Haskell (to be fair, I'd only started to learn OCaml in July :) ) and cannot compare, but many of the guys I know say that Haskell is, like, more "academic" language, while OCaml is close to the production, also, OCaml has pretty badass syntax and stuff
ygrek has joined #ocaml
<suppi>
i'm not entirely sure what that means :)
<minn>
suppi: You will give up everything great about Haskell's type system and syntax in exchange for mature standard libraries and blindingly fast code the performance of which doesn't require a PhD to evaluate.
<soupault>
I'm personally getting really confused with some of the OCaml OOP patterns, they're quite hard to understand
<chsn>
There's also Jane Street
FreeBirdLjj has joined #ocaml
<chsn>
I hear they're still OCaml, not Haskell.
<minn>
they hire haskell programmers? i thought they were strictly doing ocaml?
<chsn>
"I hear they're still OCaml, not Haskell."
<chsn>
I think we are agreeing.
<suppi>
minn, can you expand on that please? what do i need to give up? what mature about the std and how does it compare to haskells? what's the difference in performance and what requires a phd to evaluate?
MercurialAlchemi has joined #ocaml
<soupault>
according to the mailing list, OCaml is also being used in Wolfram. I find that very nice
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<chsn>
Weird, Mathemtica feels awfully dyamically typed to me.
<soupault>
Mathematica UI is not their only product
<soupault>
there is hell of a lot backend things, as well as SystemModeler, etc
<soupault>
polymorphic types, arbitrary precision and many more features well suit SystemModeler needs, I think
<chsn>
ah right
<minn>
suppi: The first thing you notice moving to OCaml is the lack of type-level predicates (type classes) and higher-kinded polymorphism (which has to be modeled using modules and functors). There are also lots of syntactic inconveniences: no operator slices, no nice notation for composition, no support for point-free programming (cf. the value restriction).
<companion_cube>
it's not exactly the same mindset anyway
<chsn>
minn: I understood all those words, except 'higher kindered polymorphism' (and google/wikipedia has not explainedto me what it is)
<companion_cube>
you gain a much easier understanding of how/when the code will evaluate
<chsn>
in practce, why does higher kindered polymorphism matter ?
<minn>
suppi: Re: "what's the differnce in performance and what requires a phd to evaluate": have you ever tried to analyze the time and space complexity of a haskell program? it's infinitely easier in a strict language.
<companion_cube>
you write more modules and more abstract types
<chsn>
companion_cube: haskell evaluation is trivial; I just simuate an spineless tagless graph in my head, and it's obvious what's a thunk and what's evaluated to weak head normal form
<companion_cube>
:DDD
<minn>
chsn: I suppose you could answer that question by answering the question: How easily can you parametrize a function by an arbitrary functor (or monad, or monoid, etc.)?
<suppi>
oh, so you mean the evaluation strategy, alright.
al-damiri has quit [Quit: Connection closed for inactivity]
<chsn>
minn: these are functions that take a *MOnad* as an arugment? i.e. it has type :: (MonadClass a) => a -> .... ?
<chsn>
so it behave differently dpeneding on whether it gets Maybe, List, IO, or LogicT ?
<minn>
chsn: Right. They abstract over types of higher kind (e.g., * -> *)
<chsn>
hmm, I don't know if I have ever used one of these
<minn>
chsn: For example, Haskell has fmap : functor f => (a -> b) -> (f a -> f b), where f has kind * -> *.
<suppi>
if you ever used Elm, plenty of functions are duplicated because of the lack of HKT
<suppi>
I guess some can be solved with proper modules as well?
<suppi>
i'm not very familiar with proper modules though :)
<suppi>
minn, and the standard lib thing? :}
<minn>
suppi: i guess that modulo the proliferation of standard libraries, you get well-tested, fast, and well-documented ones :)
<chsn>
minn: wait wait wait ... I can't write fmap in ocaml ?
<minn>
chsn: you can't write a function with that type
<chsn>
well that's pretty annoying
<suppi>
minn, can you point me to some?
<chsn>
minn: let's randomly go into channels of other langauges and bash why they'reinferior to haskell :-)
<chsn>
so what is the ocaml solution to fmap ... modules ?
<minn>
i guess?
<chsn>
I use <$> all the time
<chsn>
wait ... so OCaml doesn't ahve >>= either ?
soupault has quit [Remote host closed the connection]
soupault has joined #ocaml
soupault has quit [Remote host closed the connection]
soupault has joined #ocaml
brab has quit [Ping timeout: 276 seconds]
brab has joined #ocaml
<suppi>
Leonidas: can you write a function that will work with any >>= ?
<companion_cube>
no
<companion_cube>
(unless you put it in a module)
FreeBirdLjj has quit [Remote host closed the connection]
<suppi>
companion_cube: the function or >>= ?
<companion_cube>
both, actually
<companion_cube>
have you looked at what functors are in OCaml?
larhat1 has joined #ocaml
larhat has quit [Read error: No route to host]
fraggle_ has quit [Remote host closed the connection]
<chsn>
Leonidas: taht link loks like hoogle
<chsn>
but I don't actually understand it
<chsn>
so the point here is that if I were to write a functino which uses generic >>=, then I have to stick the functino in it's own module?
<Leonidas>
suppi: there is a proposal for modular implicits which take away some of the pain points
<suppi>
Leonidas: yeah I've heard of it but haven't actually read the paper yet. i'll look it up. thanks
manizzle has joined #ocaml
<companion_cube>
there is no "generic" >>=, because it would not be typable
<Leonidas>
chsn: yes, that's like hoogle. In OCaml, a definition of >>= is usually defined in the module which contains the type that >>= is supposed to operate on
<companion_cube>
type variables cannot be parametrized
<companion_cube>
like hoogle, but only on a few libraries
<chsn>
so is there a way to say "I have this function, which can operate on any Monad (i.e. anything with a >>=)" dfined on it ?
<chsn>
or would I have to rewrite the functin for each >>= ?
<companion_cube>
there is no such way
<companion_cube>
well, you can have a `module type Monad = sig type 'a t val return : 'a -> 'a t val (>>=) : ... end`
<chsn>
stupid_func :: (MonadClass m) => m a -> m a -> m a // stupid_func fx fy = do x <- fx; y <- fy; return (x+y) // <-- is this function writeable in ocaml?
<companion_cube>
and then write `module Foo(M : Monad) : sig val map_m : ('a -> 'b) -> 'a M.t -> 'b M.t end`
<companion_cube>
no it's not
<mrvn>
chsn: use objects
<companion_cube>
meh
<chsn>
mrvn: how would you achieve this with objects?
<companion_cube>
it's totally not idiomatic
<mrvn>
like: let ( +++ ) a b = a#add b
<mrvn>
any object with an add method can be used with +++ then
<mrvn>
otherwise you would have to wait for imlicits
<mrvn>
implicits
fraggle_ has joined #ocaml
DisownedWheat has joined #ocaml
yegods has joined #ocaml
<companion_cube>
which can take a arbitrarily long time to arrive
<companion_cube>
the current OCaml doesn't permit this kind of things at all
<Leonidas>
but as said, its also not really idiomatic in MLs.
<Leonidas>
Writing Haskell in OCaml will not be a happy experience. But then, writing Haskell in most languages wouldn't be.
<mrvn>
if you love haskell that much then just write haskell
picolino has quit [Ping timeout: 244 seconds]
ollehar has joined #ocaml
picolino has joined #ocaml
picolino has quit [Ping timeout: 264 seconds]
picolino has joined #ocaml
orbifx has joined #ocaml
<orbifx>
hello all
<ollehar>
OMG
<companion_cube>
o/
<orbifx>
you could say that ollehar
<orbifx>
although a simple "hello" would suffice
zpe has joined #ocaml
<ollehar>
companion_cube: ;)
<ollehar>
oops
<ollehar>
I mean
<ollehar>
orbifx: ;)
govg has joined #ocaml
sh0t has quit [Remote host closed the connection]
govg has quit [Ping timeout: 244 seconds]
<orbifx>
any tyxml users here?
<companion_cube>
not much
govg has joined #ocaml
DisownedWheat has quit [Ping timeout: 264 seconds]
picolino has quit [Ping timeout: 264 seconds]
picolino has joined #ocaml
Stalkr_ has joined #ocaml
soupault has quit [Read error: Connection reset by peer]
<orbifx>
was wondering how I can "inject" html code generated by something else
<companion_cube>
erf, no idea, you'd probably have to parse it
<companion_cube>
(or, if it's structured, write a recursive conversion func?)
<orbifx>
it's a string
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ocaml
soupault has joined #ocaml
<Leonidas>
you could parse it with regular expressions *ducks*
manizzle has quit [Ping timeout: 255 seconds]
suppi has left #ocaml [#ocaml]
<orbifx>
lol
<orbifx>
it has to have a way where I can tell it to take something as is, without escaping it
<orbifx>
I'll use Unsafe for now
manizzle has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
evhan has quit [Ping timeout: 255 seconds]
govg has joined #ocaml
rgrinberg has joined #ocaml
yegods has quit [Remote host closed the connection]
soupault has quit [Remote host closed the connection]
evhan has joined #ocaml
pierpa has joined #ocaml
freusque has joined #ocaml
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
shinnya has joined #ocaml
yegods has joined #ocaml
thizanne has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
nicholasf has quit [Remote host closed the connection]
kickedbrick has joined #ocaml
ollehar has quit [Ping timeout: 265 seconds]
orbifx has quit [Ping timeout: 276 seconds]
copy` has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
govg has joined #ocaml
MercurialAlchemi has joined #ocaml
freusque has quit [Read error: Connection reset by peer]
haesbaert has quit [Remote host closed the connection]
freusque has joined #ocaml
myst|fon has quit [Quit: Connection closed for inactivity]
axiles has joined #ocaml
nicoo has quit [Ping timeout: 276 seconds]
freusque has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
freusque has joined #ocaml
Heasummn has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
nicoo has joined #ocaml
<Drup>
orbitz: parse it with markup and transform it into the tyxml representation of your choice by walking the tree and using <mod>.Xml.leaf/node and <mod>.tot
freusque has quit [Ping timeout: 260 seconds]
tane has quit [Quit: Leaving]
orbifx has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
myst|fon has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
yegods has quit []
Xizor has quit [Read error: Connection reset by peer]
orbifx has quit [Ping timeout: 250 seconds]
* ggole
actually uses an object
<ollehar>
OMG
<ggole>
I bet I will regret this.
<ollehar>
on the plus side, OCaml's object system is the most interesting out there
<ggole>
That's what I'm afraid of.
<ollehar>
?
zpe has joined #ocaml
<ggole>
"Interesting" code isn't always what you would want.
zpe has quit [Ping timeout: 276 seconds]
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 276 seconds]
struk|desk has joined #ocaml
AlexDenisov has joined #ocaml
mrvn has quit [Ping timeout: 240 seconds]
mrvn has joined #ocaml
fraggle_ has quit [Ping timeout: 265 seconds]
zpe has joined #ocaml
fraggle_ has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
Submarine has joined #ocaml
jackweirdy has joined #ocaml
Algebr`` has quit [Ping timeout: 258 seconds]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
manizzle has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
zpe has joined #ocaml
Algebr`` has joined #ocaml
Algebr`` has quit [Ping timeout: 276 seconds]
jackweirdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kakadu has joined #ocaml
yegods has joined #ocaml
adelbertc has joined #ocaml
rgrinberg has joined #ocaml
Algebr`` has joined #ocaml
pierpa has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
fraggle_ has quit [Ping timeout: 265 seconds]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
zpe has quit [Ping timeout: 252 seconds]
Algebr`` has quit [Ping timeout: 252 seconds]
fraggle_ has joined #ocaml
Ravana has quit [Ping timeout: 252 seconds]
TheLemonMan has joined #ocaml
bruce_r has joined #ocaml
fraggle_ has quit [Ping timeout: 264 seconds]
ggole has quit []
fraggle_ has joined #ocaml
Algebr`` has joined #ocaml
ollehar has quit [Quit: ollehar]
ygrek has joined #ocaml
Algebr`` has quit [Ping timeout: 264 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
minn has joined #ocaml
fraggle_ has quit [Ping timeout: 264 seconds]
tmtwd has quit [Ping timeout: 244 seconds]
nicholasf has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
d0nn1e has quit [Ping timeout: 258 seconds]
d0nn1e has joined #ocaml
tmtwd has joined #ocaml
freusque has joined #ocaml
bruce_r has quit [Ping timeout: 264 seconds]
rand__ has quit [Quit: leaving]
nicoo has quit [Ping timeout: 276 seconds]
tmtwd has quit [Ping timeout: 258 seconds]
ygrek has quit [Remote host closed the connection]
nicoo has joined #ocaml
tmtwd has joined #ocaml
Simn has quit [Read error: Connection reset by peer]