<gfixler>
not quite understanding the bit about weak/strong ascription
<gfixler>
"Weak ascription (:) means that the constructors of abstract types are still accessible, but the signature does hide all unrelated declarations in the module."
<gfixler>
"Strong ascription (:>) makes the abstract types actually abstract.
<gfixler>
"
freehck has joined #ocaml
adelbertc has quit [Quit: Connection closed for inactivity]
kolko has quit [Ping timeout: 244 seconds]
kolko has joined #ocaml
ggole has joined #ocaml
Simn has joined #ocaml
Reshi has quit [Ping timeout: 248 seconds]
<flux>
I guess the concepts don't exactly match the ones of OCaml..
<gfixler>
I guess not
myst|fon has quit [Ping timeout: 260 seconds]
myst|fon has joined #ocaml
teknozulu has quit [Ping timeout: 268 seconds]
sfri has quit [Ping timeout: 260 seconds]
sfri has joined #ocaml
<Algebr`>
I am grateful that #ocaml isn't a cesspool like #c is.
Lasher` has quit [Read error: Connection reset by peer]
wolfcore has quit [Ping timeout: 260 seconds]
wolfcore has joined #ocaml
Kakadu has joined #ocaml
nicholasf has quit [Remote host closed the connection]
wiredsister has quit [Ping timeout: 250 seconds]
julien_t has joined #ocaml
Algebr` has quit [Remote host closed the connection]
<orbifx>
Can you recommend a library for.saving settings? Preferably in yaml or equivalent.
nicholasf has joined #ocaml
<lyxia>
Simn: I think you can move the types to a single .ml, and then use include in other modules
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
<Simn>
Thanks lyxia, that's what I found too. I was concerned about losing BasicBlock.t, but I suppose I can just `type t = whereverIMovedIt.t` in the .mli.
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
<lyxia>
Simn: I mean you don't even need to type "type t = Blabla.t", you can make it just one include line in basicBlock.ml and basicBlock.mli
<Simn>
What do you mean when you say "include line"?
<dsheets>
not recursion in the data but in the types. perhaps path names are sufficient...
<flux>
as in arrays of arrays?
<flux>
hmm, it does support arrays of arrays
<dsheets>
companion_cube: perhaps somewhere? i seem to recall that there was a project that depended on it in some way. I'd like to remove the dependency as it isn't maintained.
<dsheets>
flux: perhaps it has changed in a recent version, i'll have another look. sorry for the fud
<flux>
dsheets, I don't know remember what the toml library supports, but if it didn't support them at 1.x, it might support them now at 4.x
<dsheets>
oh, i mean the actual specification was fairly special for a while
<companion_cube>
dsheets: I'm asking the (non)maitnainer if he wants to pass the project
<companion_cube>
the library looks really nice
palomer has joined #ocaml
<palomer>
hey everyone
<palomer>
I’m getting this error while using ocamlbuild/ocamlfind. I tried googling it to no avail
<palomer>
Error: No implementations provided for the following modules: Str referenced from test2.cmx
<dsheets>
ah, good, it needs to be maintained or an alternative used. i think nocrypto may eventually be suitable if it isn't already... there is some libgmp dep that is annoying right now, i think
ygrek has joined #ocaml
<dsheets>
palomer: you need to use the `str` package with something like <*.{ml,mli}>: package(str) in _tags in your src dir
<dsheets>
also `-use-ocamlfind` may be required as an argument to your `ocamlbuild` invocation
<palomer>
dsheets: it’s there
<palomer>
oh wait, it works now
<palomer>
:P
<dsheets>
\o/
<palomer>
the dependency is also needed for all targets that depend on test2
Kakadu has quit [Quit: Page closed]
ollehar has joined #ocaml
<flux>
wish -use-ocamlfind just ended up as the default :). or does it break something?
<dsheets>
i think there was resistance to putting a dependency on ocamlfind from the distribution ocamlbuild
<dsheets>
ocamlbuild has been moved out of the distribution now and i think its tracker has an issue discussing this very point with the idea that maybe it will shift to the default slowly
sgeisenh has left #ocaml ["WeeChat 1.2"]
<Drup>
They tried to make it the default, but did that with the same release that they adedd -no-use-ocamlfind, which was not a great move
Haudegen has quit [Ping timeout: 250 seconds]
<Drup>
no that -no-use-ocamlfind has been there for some release, it should not be such an issue
dsheets has quit [Remote host closed the connection]
struk|desk|away is now known as struk|desk
dsheets has joined #ocaml
<orbifx>
Do I need to use the package flag for toml lenses?
<flux>
"the package flag"?
<orbifx>
It's telling me that table is not a function :-S
<orbifx>
flux: -package toml-lenses
<orbifx>
Or something like that.
<flux>
no, there's only one package called toml
<flux>
oh diety! I noticed this horrible thing from toml: requires = "str unix ISO8601"
<orbifx>
?
<flux>
str!
<companion_cube>
wat
<companion_cube>
it's not in the opam dependencies
<companion_cube>
I feel like alcotest is the hipster version of ounit, am I right?
<companion_cube>
nice work dsheets
struktured has quit [Ping timeout: 244 seconds]
<dsheets>
ha, maybe. ounit got in my way too much and i'm not very fond of the 2.0 api. alcotest seems more accessible for contribution but maybe that's just me...
<companion_cube>
ounit1 is fine, I think
<companion_cube>
bleh, alcotest depends on oasis -_-
<dsheets>
I think ptime's limited ISO8601 parsing may be the answer to the date parsing issue but someone needs to read the toml spec and decide what is really required for conformance
<dsheets>
I'm not sure why it depends on oasis :-/ I wish people would stop using it.
<companion_cube>
oasis?
<companion_cube>
yeah, well, I use it quite a lot in some projects, but I generate files for releases
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
malina has quit [Ping timeout: 260 seconds]
struktured has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
<Maelan>
is there a predefined function that gives both the quotient and remainder of a division on regular ‘int‘s?
<companion_cube>
sadly, no
malina has joined #ocaml
noddy has quit [Ping timeout: 248 seconds]
struktured has quit [Ping timeout: 252 seconds]
slash^ has joined #ocaml
palomer_ has joined #ocaml
palomer has quit [Ping timeout: 276 seconds]
palomer_ is now known as palomer
dwillems has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
mettekou has quit [Read error: Connection reset by peer]
larhat has quit [Quit: Leaving.]
yegods has quit [Remote host closed the connection]
jgjl has joined #ocaml
inr has quit [Read error: Connection reset by peer]
inr has joined #ocaml
dsheets has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 264 seconds]
dsheets has joined #ocaml
dhil has joined #ocaml
ygrek has joined #ocaml
ollehar has joined #ocaml
yegods has joined #ocaml
<struk|desk>
Maelan: made me realize that (extended) gcd probably isn't readily available either
aantron has quit [Remote host closed the connection]
anoisz has quit [Read error: Connection reset by peer]
aantron has joined #ocaml
noddy has joined #ocaml
leyyin has joined #ocaml
ollehar has quit [Quit: ollehar]
Anarchos has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mettekou has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
mettekou has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
<malina>
I keep getting syntax error, I used to do sml (mosml) but looking at my old sm bok.
<malina>
combined wityh ocaml stuff form net, I kept moving *( around etc, but why isthis simple thing wrong?
<malina>
pardon for those typos, my usb keyboard is a biit foobar
ollehar has joined #ocaml
<pierpa>
malina: is wrong because it's sml, not ocaml
Haudegen has quit [Ping timeout: 260 seconds]
<ansiwen>
I'm trying to give clang on Mac OS some compiler-flags when installing with opam by using `CFLAGS=... opam install ..." but they seem to be ignored... what am I doing wrong?
<ansiwen>
i mean, if I - as a test - enter `CFLAGS=foobar opam install arakoon`, it should immediately fail because of the "foobar", but it doesn't. still fails with the original error
<Algebr>
maybe run with also OPAMVERBOSE=1, it might dump the actual compiliation commands?
<Algebr>
see if its actually using the cflags
<ansiwen>
Algebr: if OPAMVERBOSE=1 is the same as opam install --verbose arakoon, then no, it doesn not use the cflags
<seangrove>
companion_cube: What's qtest? Is it related to property-based/generative testing?
<companion_cube>
yes
<companion_cube>
it's a random testing library, + a tool for extracting tests from comments
<companion_cube>
(optional)
<ansiwen>
Algebr: so you mean, installing from sources? or can I "patch" the makefile from the opam call somehow?
<Algebr>
maybe change the makefile, then do: opam pin add <package_name> .
jeffmo has joined #ocaml
kdas_ has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
Haudegen has joined #ocaml
<malina>
pierpa, hi there, sorrry I was afk. Yes but could someone give me a hint, i feel I have covered theocaml stuff and I just always get syntax errors
<malina>
for something this simple :/
ollehar has quit [Ping timeout: 246 seconds]
<malina>
are undersocres not part of ocaml btw?
<lyxia>
underscores mean wildcard pattern
<lyxia>
you need to write either "function" or "match" to do pattern matching
<pierpa>
malina: I posted an ocaml version of your function
<malina>
pierpa, yes, sorry about that. I somehow missed it. :)
<malina>
aha.. I have tried pretty muvh everything _except_ thiat line [] -> []
<malina>
thanks :)
<pierpa>
you're welcome (btw, the ; should be a l)
<malina>
get a unbound error on the then {} clause
<pierpa>
"let rec" instead of "let", sorry
<malina>
it seems to me that x is of different type
<malina>
aha
<malina>
YES! hehe.. yes in sml rec didn't exists iirc
<pierpa>
in ml all is rec by default
<pierpa>
*in sml
<malina>
thank you.. another silly question.. I read lines from a file into ocaml, and it is quite a long string list, does the memory allocation in a (buffer stream?) automatically size itself, or dcan it overflow?
<malina>
can* sorry, usb keyb is broken
<pierpa>
not sure I understand the question, but probably there's no need to worry about this
<malina>
ok pierpa.. no it might be that my bash environment seems to be a bit odd with the output from ocaml when I pass a file into it.
<pierpa>
or at least, worry about it when it doesn't work. If it works, leave it alone :)
<malina>
:D
<malina>
true, I for now did a head -n10 of the file (which has 3500 lines in it normally) :D
<pierpa>
k
<malina>
:)
<malina>
I culd bash it in 10 mins but it is a nice problem to use to do my first ocaml program I think.
julien_t has quit [Ping timeout: 248 seconds]
<malina>
(sort and trim old packages with somewhat pseudo-arbitrary revision numbers)
<mrvn>
On 32bit strings are limited to 16MB. Just resizing might be enough.
<malina>
presumtion: file has sorted strings . recent should in a sorted list, only keep the first encountered same basename (I understand that the 'sorted' and order might differ in a list in ml, that is next when I know it works)
<malina>
ok thanks mrvn
<mrvn>
lists are endless though
<malina>
my `pwd` is right now marvin he
<malina>
(as a homage to Marvin the optimist)
<malina>
"optimist" rather
<malina>
16M is plenty, but I got output of a string list like [s1,s2,s3...... and it ended only at c (from a-z) suffixed with ...*] or so.. not sure if that is just my shell being weird as it seems to not paarse output so well.
<mrvn>
the runtime has a recursion limit when printing. at some point it stops wiht ...
<pierpa>
that is the ocaml toplevel trying t help you by not showing all of a big data structure
<malina>
mrvn, pierpa : thank you, as expected (sorry about being so verbose.. I just was a bit new).. Aha, although am I right in thinking you provide x as a list, whereas I am looking for a string * list, no?
<malina>
in if x= y, is x implicitly the head of l or l itself?
<malina>
ah I see. the return is the list of non-repeated list elements. (Ok, I will be away and stop bothering you! :p) x
nicholasf has joined #ocaml
octachron has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<pierpa>
malina: I have no idea of what the function does. I just translated your sml to ocaml
dwillems has quit [Ping timeout: 244 seconds]
julien_t has joined #ocaml
<malina>
ya.. as a sub-routine, I wanted to do something like a list of strings, where start popping the head, then check head(x::L) vs next head for equality(y), if yes, discard (first x), check y with next head and os on, so that no recurrences of a string is left.
<malina>
if they are equal, then skip x, and set next head to x
<pierpa>
ok
dsheets has quit [Remote host closed the connection]
<malina>
I will just readon a bit on ocaml syntax till I make sure I get it right :) you have been a great help.
<pierpa>
what are you reading?
dsheets has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
seangrove has quit [Ping timeout: 252 seconds]
dsheets has quit [Read error: No route to host]
dsheets has joined #ocaml
slash^ has left #ocaml [#ocaml]
julien_t has quit [Ping timeout: 248 seconds]
dsheets has quit [Ping timeout: 244 seconds]
<malina>
introduction to sml programming (Danish blokes MIke Hansen & Hans Rischel) + the ocaml.org things and just stack exchange and godknows how many messy 100 N tabs I have open
<pierpa>
there are several free book about ocaml on the net. I think one of these would a better route to learning
<malina>
pierpa, yes o fcourse.. I downloaded the manual of ocaml and have the turorials open. But I was reading this book whilst at hospital (visiting someone) so it was a way of refreshing an long lost memory
hxegon is now known as hxegon_AFK
hxegon_AFK is now known as hxegon
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
julien_t has joined #ocaml
dsheets has joined #ocaml
mettekou has joined #ocaml
julien_t has quit [Ping timeout: 244 seconds]
ggole has quit []
<Maelan>
struk|desk, what do you mean, “readily”? it actually exists?
octachron has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
dsheets has quit [Remote host closed the connection]
zarul has quit [Changing host]
zarul has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
<Maelan>
struk|desk, indeed, i used zarith recently and found these functions in the doc, but today my question was really for ints :-)
<struk|desk>
Maelan: fair enough, yeah the int[32|64] function suite leaves much to be desired
mettekou has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
_andre has quit [Quit: leaving]
dwillems has joined #ocaml
schive has quit [Quit: Leaving]
dsheets has quit [Ping timeout: 240 seconds]
mettekou has joined #ocaml
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
BitPuffin has quit [Read error: Connection reset by peer]
malina has quit [Ping timeout: 244 seconds]
julien_t has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
marsam has joined #ocaml
malina has joined #ocaml
nicholasf has joined #ocaml
dwillems has quit [Ping timeout: 248 seconds]
Kakadu has joined #ocaml
dwillems has joined #ocaml
octachron has quit [Ping timeout: 250 seconds]
<malina>
why can't one do x::(alternatively @) function y (where y is of type a' list and x is of type a'), or rather: how can one recursively add x to a new list whilst popping y? recursively
<malina>
y is not a cherry
<malina>
except for (mar)y with the cherry
<mrvn>
EPARSE
<malina>
oki
<pierpa>
malina: of course you can. Post the exact code it's not working
octachron has joined #ocaml
<malina>
ok one sec
<malina>
was too embarrasse dot ask and I have probably done 100 permutations though, until my eyes changed their positions
<malina>
(let me just resahuffle a bit as last ones were just wrong)
<malina>
forget that first one with [x;y] clause, was syntactically wrong.
<malina>
the others when encounter the hd error out on type 'a which makes sense but I can't get how to do what I want. but headache an hour ago and I have given up and reisgned myself to being a snail or something.
<malina>
(I am not bothered right now with the problem I was solving, just testing out compositions)
seangrove has joined #ocaml
struk|desk is now known as struk|desk|away
<pierpa>
let's look at this line: | x::y::l -> if x = y then y @ recent l else x @ recent l;;
<pierpa>
<pierpa>
"recent l" is not a list
<octachron>
malina, what type do you want for "recent"?
<pierpa>
recent takes two arguments. if you supply only one you have a partial application
<pierpa>
so, it's not a list
snhmib has joined #ocaml
madroach has joined #ocaml
darkf has joined #ocaml
<malina>
oops sorry
<malina>
:(
<malina>
I want
<malina>
string list
yegods has quit [Remote host closed the connection]
<malina>
sure i could do two args
<malina>
string & string list
<malina>
s/&*/
<malina>
sorry guys. I was away from keyboard
yegods has joined #ocaml
<malina>
recent l is I thought l (a list) as input to recent, and we define recent as taking a list as input, no?
<malina>
I have a list, which as I pop the head, I wish to only keep the last occurence of a member of that list, i.e. the base case(s) would be either empty set or a singleton . (also, single occurrences should be kept )
<malina>
also, I have ordered the list so that any occurrences of an element will be in succession
<malina>
hence the if x::y::L <-> if x !=y, keep x, else keep y as x
<malina>
and keep traversing so to speak
<mrvn>
match it
<malina>
keeping means here adding to an empty list which can be returned say
<mrvn>
x::y::zs when x = y ->
mettekou has quit [Read error: Connection reset by peer]
<malina>
ok.. hmm, I am sorry for being so ignoran,t but could you give me a paste of how this would look like?
dwillems has quit [Ping timeout: 246 seconds]
<malina>
for as it seems, I keep just messing up and I am literally feeling like a 4 year old today.
<mrvn>
let rec loop = function [] -> [] | x::(y::_ as xs) when x = y -> loop xs | x::xs -> x :: (loop xs)
chindy has joined #ocaml
<malina>
thanks, brb , will try.
<malina>
that looks sane
<malina>
btw
<mrvn>
not tail recursive though
<malina>
WORKS
<malina>
YES oh my Lords and Heavens and Hells!!! <3333
<malina>
no, but I can probably figure that out if it is needed.. I just needed to figure this out, and wow, half a day gone :'( but thank you though vry much for your (pl.) patience!
mettekou has joined #ocaml
<malina>
I can label the occurences, so I don't think in the simple problem I was working on needs it.
<malina>
(tail recursion I mean)*
<malina>
this feels a bit like trying to cook an egg whilst dancing and changing a tyre on a car, when none have been attempted before! :)
<Algebr>
yep
<malina>
Now shall follow a week of reading ! then I shall take over the world (read: my mini projects locally on a computer) :))
<Algebr>
gluck
julien_t has quit [Ping timeout: 248 seconds]
octachron has quit [Quit: Leaving]
Reshi has joined #ocaml
<malina>
Canuck?
<malina>
:p
<Algebr>
gevent is like python's version of lwt
wiredsister has quit [Ping timeout: 250 seconds]
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
wiredsister has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
snhmib has quit [Ping timeout: 240 seconds]
marsam has quit [Read error: Connection reset by peer]
mettekou has quit [Read error: Connection reset by peer]
Simn has quit [Quit: Leaving]
Reshi has quit [Ping timeout: 248 seconds]
BitPuffin|osx has joined #ocaml
malina has quit [Ping timeout: 246 seconds]
Kakadu has quit [Remote host closed the connection]