<Han_>
In signature, does 「type 'a t」and 「type t」equals?
<whitequark>
no.
<whitequark>
they have different arity and are incompatible.
<Han_>
I know that what should I specific the type in module for [type t] is something like [type t=int], but I don't know how to specific the [type 'a t] case
<kaustuv>
Wasn't there supposed to be an updated manual with details of how to use -ppx for the 4.02.1 release? (ping gasche, whitequark)
bytbox has quit [Remote host closed the connection]
psy has quit [Ping timeout: 246 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
thomasga has joined #ocaml
psy has joined #ocaml
<troydm>
anyone familiar with obuild tool?
<Drup>
since the author is the only one using it, you can ask him :]
shinnya has joined #ocaml
<jpdeplaix>
troydm: I do
<jpdeplaix>
Drup: some people use it
<Drup>
I know, just trolling :)
bytbox has joined #ocaml
<troydm>
I've specified a dependency using deps now this dependency has some additional modules that I want to use
<troydm>
and if I specify them as dependency too, they aren't found since there is no META for them since they are part of this dependecy meta
<troydm>
so obuild can't find them
badkins has joined #ocaml
parcs has quit [Remote host closed the connection]
<troydm>
ahhh, nvm I've found it, it needed to be specified as subpackage
<troydm>
I was not familiar with subpackage notion
<jpdeplaix>
oh, right. Ok. It was an ocamlfind question then :)
badkins has quit [Ping timeout: 240 seconds]
parcs has joined #ocaml
badkins has joined #ocaml
BitPuffin has joined #ocaml
samrat has joined #ocaml
bytbox has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
sepp2k has joined #ocaml
thomasga has quit [Quit: Leaving.]
Cypi has quit [Ping timeout: 260 seconds]
reventlov has quit [Ping timeout: 240 seconds]
Cypi has joined #ocaml
reventlov has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
_5kg has quit [Ping timeout: 260 seconds]
jonludlam has joined #ocaml
George has joined #ocaml
<George>
Hi, are ocaml data structures such as hashtable are naturally mutable? I mean, applying Hashtabl.remove modifies hashtable in place
shinnya has quit [Ping timeout: 260 seconds]
<companion_cube>
yes, it is a mutable structure
<companion_cube>
unlike Map, which is persistent
<George>
Thanks
<mrvn>
You can see that from the return type. Mutable structures return unit on modifying commands, persistant structures return the new structure.
SethTisue has joined #ocaml
<George>
hmmm, good point.
<George>
Thanks
tnguyen1 has quit [Ping timeout: 246 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
AlexRussia has joined #ocaml
<AlexRussia>
tane: hey ;)
SethTisue has quit [Ping timeout: 244 seconds]
<tane>
yo :)
AlexRussia_m has quit [Quit: AtomicIRC: The nuclear option.]
<AlexRussia>
tane: hm, what mean keyword when in match construction?
<tane>
i guess you're referring to the aforementioned guards?
<AlexRussia>
tane: i referring to private messages :P
<tane>
yes, indeed
<AlexRussia>
tane: guards?
<tane>
AlexRussia, search the PDF for guards
<tane>
or "guard"
<tane>
you'll see then
<tane>
page 92
tnguyen has joined #ocaml
<AlexRussia>
tane: ok, i got it
BitPuffin has joined #ocaml
Plazma has quit [Remote host closed the connection]
Plazma has joined #ocaml
marynate has joined #ocaml
BitPuffin has quit [Ping timeout: 272 seconds]
eizodo has quit [Quit: Page closed]
thomasga has joined #ocaml
_5kg has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
jao has quit [Ping timeout: 272 seconds]
cesar has joined #ocaml
cesar is now known as Guest52782
Guest52782 has quit [Ping timeout: 240 seconds]
cago has left #ocaml [#ocaml]
thomasga1 has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
samrat has quit [Ping timeout: 272 seconds]
thomasga has quit [Ping timeout: 265 seconds]
AdmWiggin is now known as tianon
thomasga1 has quit [Ping timeout: 246 seconds]
q66[lap] has joined #ocaml
bytbox has joined #ocaml
samrat has joined #ocaml
Thooms has joined #ocaml
nlucaroni has joined #ocaml
mcclurmc has joined #ocaml
hyperbor1ean is now known as hyperboreean
larhat has quit [Read error: Connection reset by peer]
larhat1 has joined #ocaml
nojb has joined #ocaml
SethTisue has joined #ocaml
SethTisue has quit [Client Quit]
SethTisue has joined #ocaml
tristero has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
SethTIsue_ has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
SethTisue has quit [Ping timeout: 244 seconds]
SethTIsue_ is now known as SethTIsue
eikke has quit [Ping timeout: 246 seconds]
BitPuffin has joined #ocaml
esden has joined #ocaml
octachron has quit [Quit: Leaving]
<jpdeplaix>
gasche: is ocamlbuild supposed to stop target compilation after the first error ? Like if I do « ocamlbuild a.cmo b.cmo », if a.cmo fails, b.cmo will not be compiled.
badkins has quit [Read error: Connection reset by peer]
WraithM has joined #ocaml
<Denommus>
yay, inlined records!
<whitequark>
yup, in trunk
<Drup>
yep
<adrien_oww>
merged?
c74d has quit [Remote host closed the connection]
<adrien_oww>
oh :)
<adrien_oww>
means I won't receive mails anymore from mantis on that topic! \o/
<companion_cube>
neat
c74d has joined #ocaml
morphles has joined #ocaml
<nlucaroni>
I'm getting 'camlp4 is not available because it requires OCaml >= 4.03.0' with opam 1.2 and ocaml 4.02.1 . Is this known?
<nlucaroni>
(via travis build 32minutes ago).
zpe has quit [Remote host closed the connection]
<Drup>
nlucaroni: yes, it needs a fix that has been PR against opam-repository but not merged yet
<rks`>
adrien_oww: I find that conclusion slightly optimistic :)
<adrien>
='(
vfoley- has quit [Remote host closed the connection]
ollehar has joined #ocaml
<reynir>
what are inlined records?
<Drup>
type foo = A {x : int ; y : int}
<Drup>
A of *
<reynir>
Hm, interesting
Thooms has quit [Quit: WeeChat 1.0.1]
<reynir>
I actually kinda thought this was already in OCaml :)
<nlucaroni>
thank Drup.
<Denommus>
reynir: so now you can have type 'a bin_tree = Node of {v: 'a ; l: 'a bin_tree ; r: 'a bn_tree} | Leaf of 'a
<reynir>
so if you have [match (bar : foo) with A xy -> ...], what type does xy have? Using the type foo you defined above
<ggole>
Mutable fields, too
<mrvn>
reynir: whatever type A has
<Drup>
reynir: you can't make this record escape, it doesn't have any exportable type on it's own
<mrvn>
Can I do 'A { r with x = 1; }'?
<Drup>
yes
<Drup>
given that you obtained the r by pattern matching on A
<mrvn>
but for that I have to match the record first, right?
nojb has quit [Ping timeout: 272 seconds]
<mrvn>
as in : let foo x = match x with A r -> A { r with x = 1; }
jwatzman|work has joined #ocaml
<mrvn>
or can I do: let foo r = { r with x = 1; }
<Drup>
on the other hand, if you have only one constructor, why are you using a constructor ? :)
SethTIsue has quit [Quit: SethTIsue]
<mrvn>
Drup: because I'm too lazy to type an example with more constructors
<Drup>
if you have more constructors, you can't be sure the field exist, so you can't replace things like that, you have to pattern match :p
<Bluddy>
unlike haskell, which will just throw an exception when you try to change the non-existing field
<Bluddy>
:)
<mrvn>
Drup: right, you don't know it's an A... without match.
<Drup>
yeah, I still don't understand how they could possibly make such a huge mistake and not fix it.
<whitequark>
O_o
<companion_cube>
:D
<Drup>
I don't get it.
<whitequark>
are we talking about the same Haskell?..
<companion_cube>
wow, much safety
<Drup>
yeah ...
<whitequark>
it's the people obsessed with type system, right?
SethTIsue has joined #ocaml
nojb has joined #ocaml
cesar has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
cesar is now known as Guest50540
gperetin has joined #ocaml
badkins has joined #ocaml
tnguyen has quit [Ping timeout: 244 seconds]
Guest50540 has quit [Ping timeout: 260 seconds]
tnguyen has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
tnguyen has quit [Ping timeout: 250 seconds]
esden has joined #ocaml
vogler has quit [Ping timeout: 260 seconds]
SethTIsue has quit [Quit: SethTIsue]
tnguyen has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
dsheets has quit [Ping timeout: 255 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
Hannibal_Smith has joined #ocaml
lordkryss has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
kakadu has quit [Quit: Page closed]
SethTIsue has joined #ocaml
thomasga has quit [Client Quit]
thomasga has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
esden has joined #ocaml
gperetin has joined #ocaml
_whitelogger_ has quit [Ping timeout: 260 seconds]
_whitelogger_ has joined #ocaml
SethTIsue has quit [Client Quit]
morphles has quit [Ping timeout: 255 seconds]
ygrek has joined #ocaml
nojb has quit [Ping timeout: 240 seconds]
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
_whitelogger_ has joined #ocaml
SethTIsue has joined #ocaml
tnguyen has quit [Ping timeout: 240 seconds]
SethTIsue has quit [Client Quit]
tnguyen1 has joined #ocaml
SethTIsue has joined #ocaml
_whitelogger__ has joined #ocaml
George has quit [Ping timeout: 246 seconds]
thomasga has quit [Client Quit]
thomasga has joined #ocaml
tac-tics has joined #ocaml
malo has joined #ocaml
<_obad_>
I noticed that when I use Lwt it creates 2 extra threads; so I tried using the select engine and I still get those extra threads. not that I hate threads but I'm trying to reduce scheduling jitter
<_obad_>
(FYI I'm bit-banging a PWM signal for temperature control...)
<whitequark>
a good solution is to not do that.
thomasga has quit [Quit: Leaving.]
<whitequark>
Lwt is not suited for realtime scheduling.
<_obad_>
well I don't need "real" realtime but I'm wondering where the jitter comes from
<whitequark>
you do, otherwise you wouldn't care about jitter.
<_obad_>
alright I do care about jitter
<whitequark>
and, well--the OS doesn't really provide much guarantees about scheduling.
<whitequark>
it will preempt your threads as it sees fit. so, my suggestion is to bind a pwm driver to your gpio
<whitequark>
you're using Linux, aren't you?
<_obad_>
yeah
<whitequark>
it's a much better, reliable solution.
<_obad_>
so I write a kernel module?
sheijk has joined #ocaml
<whitequark>
what kind of hardware do you use? rpi?
<_obad_>
well I agree it's a clean solution (a cleaner one would be to ask the fpga guy to add a pwm), but this thing needs to be shipped yesterday, so I'm wondering if there's something simple I could do to reduce jitter. I could write a pwm loop in c maybe and control that from ocaml
<whitequark>
sigh. well. I would indeed add a thread entirely written in C and set realtime scheduling policy for it
<_obad_>
I have ~5 ms jitter, and a PWM period of 100 ms is OK. I'd like better than 5 ms jitter. but maybe I'm hitting into scheduling. an strace showed an awful amount of futex() business so...
<_obad_>
yeah something like that.
Submarine has joined #ocaml
Submarine has joined #ocaml
<whitequark>
it could be problematic, depending on exact details of your board
<whitequark>
(like if it does some heavy lifting in irqs, you aren't going to make it)
cago has joined #ocaml
<whitequark>
oh, also.
<whitequark>
is it single-core?
<_obad_>
well I'm suspecting the spi driver isn't very efficient
<_obad_>
no it's dual cortex a9
<whitequark>
you could pin your PWM thread to one core and everything else to another.
pyon has quit [Quit: rcirc on GNU Emacs 24.3.1]
<whitequark>
well, PWM thread and maybe some background stuff that can be easily preempted.
pyon has joined #ocaml
<_obad_>
might be easier to bring in the kernel pwm module though. what kind of interface does it expose, sysfs?
<whitequark>
standard sysfs pwm interface, yes
<whitequark>
it should be bound to gpio in the board configuration though
dsheets has joined #ocaml
<whitequark>
struct platform_device and all that
<_obad_>
oh wait it's not openfirmware aware?
<whitequark>
no.
<_obad_>
arghl
samrat has quit [Quit: Computer has gone to sleep.]
<_obad_>
generally not too hard to fix though. ok well thanks
<_obad_>
jesus that soft_pwm code is crappy. and it doesn't work.
badkins has quit [Read error: Connection reset by peer]
<whitequark>
told you :D
<whitequark>
is it a significant obstacle to add a platform_device for gpio-pwm?
<_obad_>
it doesn't even validate the gpio number you give it as an argument :(:(:( I'm gonna spend 15 minutes not more
<_obad_>
whitequark: well we do everything through DTSes... it would suck to have a board-specific platform. not the way to do things. so if I had to use that I would add in of support
<whitequark>
ah, right
Thooms has joined #ocaml
<_obad_>
finally, it works. just had to call gpio_direction_output()
claudiuc has joined #ocaml
ollehar has quit [Quit: ollehar]
ollehar has joined #ocaml
lilred has quit [Remote host closed the connection]
Arsenik has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
<jpdeplaix>
whitequark: is there a way to define a type with the llvm ocaml api ? Like: « %T1 = type {i32, i8*} »
<whitequark>
try changing it so that it will add t*1000 to now rather than desc->next_tick
<_obad_>
whitequark: ok trying
<whitequark>
if I'm right, you should see on your scope a still broken pattern but it will be broken in a different way
<whitequark>
more like from 5000 to 10000 (if your duty cycle is 5000ns)
<whitequark>
er us
zpe has quit [Remote host closed the connection]
<_obad_>
whitequark: oh shit I introduced a silly mistake while reformatting. and C's weak typing only produced a warning. around line 297
zpe has joined #ocaml
<whitequark>
oh
<whitequark>
crap, missed it
zpe has quit [Remote host closed the connection]
gperetin has quit [Ping timeout: 260 seconds]
esden has quit [Ping timeout: 260 seconds]
<whitequark>
while you're at it, another thing that worries me is how it starts timer and immediately returns HRTIMER_NORESTART, that doesn't make sense
<whitequark>
it should return HRTIMER_RESTART and do hrtimer_forward rather than hrtimer_start
<_obad_>
hmm.. another thing is that if you set the duty cycle to 100% you don't get any output
badkins has joined #ocaml
<whitequark>
that's easy to fix :)
gperetin has joined #ocaml
dav_ is now known as dav
uggwar has joined #ocaml
<_obad_>
what about the hrtimer_start in pwm_store?
thomasga has quit [Read error: Connection timed out]
thomasga has joined #ocaml
yomimono has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
esden has joined #ocaml
path[l] has joined #ocaml
<path[l]>
hi, is there an idiomatic way to apply a function repeatedly n times given an n? I can implement this using recursion, but I wondered if it already exists
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
ollehar has quit [Ping timeout: 250 seconds]
Simn has quit [Quit: Leaving]
Intensity has joined #ocaml
<def`>
path[l]: unless you are using Core or Batteries, the answer is usually do-it-yourself :)
<path[l]>
oh ok cool, thanks
Hannibal_Smith has quit [Quit: Sto andando via]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
_whitelogger__ has joined #ocaml
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
eikke has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
dsheets has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
_whitelogger__ has joined #ocaml
WraithM has quit [Ping timeout: 272 seconds]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
_whitelogger__ has joined #ocaml
tac-tics has quit [Ping timeout: 265 seconds]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
tnguyen1 has quit [Quit: tnguyen1]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
<Leonidas>
Drup: Just tried your lwt.ppx code. Worked perfectly with oasis, I just replaced 'lwt' by 'let%ppx' and everything compiled without any problems. Thanks, that's really neat.
<Drup>
I wouldn't say it's mine, whitequark did a big part :D
<Drup>
but good to hear :)
darkf has joined #ocaml
<Leonidas>
I saw your name on the commit, that's why. So thanks also to whitequark, who seems to be the definite resource on ppx :-)