<div dir="ltr"><div dir="ltr"><div>I don't know whether this is helpful, but Purescript provides a way to specify the kinds of IO a monad can do. For instance, the Extensible Effects section[1] of Purescript by Example includes this code snippet:</div><div><br></div><div>    > :type main</div><div>    forall eff. Eff (console :: CONSOLE, random :: RANDOM | eff) Unit</div><div><br></div><div>[1] <a href="https://leanpub.com/purescript/read#leanpub-auto-extensible-effects">https://leanpub.com/purescript/read#leanpub-auto-extensible-effects</a></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 19, 2018 at 8:11 PM Vanessa McHale <<a href="mailto:vanessa.mchale@iohk.io">vanessa.mchale@iohk.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There's a lot of other stuff going on too, not just binary sizes - GHC's<br>
runtime, a dynamic memory allocator, etc. I would hesitate to use<br>
Haskell in the embedded context or for hardware-level stuff. I presume<br>
GHC's approach to laziness has a role in this.<br>
<br>
I don't have much experience with OCaml but my experience with ATS is<br>
that it's very much possible to have functional, ML-style programming<br>
without a runtime or even dynamic memory allocation.<br>
<br>
On 10/19/18 4:02 PM, Andreas Reuleaux wrote:<br>
> While this may not be an answer to your specific question,<br>
> you may want to have a look at MirageOS, the Operating System<br>
> written in Ocaml by Anil Madhavapeddy el.,<br>
> <a href="https://mirage.io/" rel="noreferrer" target="_blank">https://mirage.io/</a><br>
><br>
><br>
> We had discussed this some while ago in our seminar,<br>
> and I learned that Ocaml may be a better fit for<br>
> writing an operating system than Haskell, due to Ocaml's<br>
> ability to produce small binaries, smaller than Haskell<br>
> binaries in any case usually. - Being involved with<br>
> Haskell personally, I would like to be proven wrong,<br>
> of course (ie. I would like to see small Haskell binaries),<br>
> and I have heard of some former efforts of writing an OS in Haskell<br>
> as well (but I would have to search for links).<br>
><br>
><br>
> just my 2 cents,<br>
>   Andreas<br>
><br>
><br>
><br>
><br>
> Yotam Ohad <<a href="mailto:yotam2206@gmail.com" target="_blank">yotam2206@gmail.com</a>> writes:<br>
><br>
>>  Hi,<br>
>> In the last couple of days, I've been toying with the thought of an<br>
>> operating system in which programs (or more accurately, any process) has a<br>
>> distinct type which limits<br>
>> its use of the machine. For example, `echo` (String -> String) won't be<br>
>> able to print an output without a second program which would handle<br>
>> changing stdout.<br>
>><br>
>> I think it could "break down" the IO monad into other structures that are<br>
>> better at specifying what is changing: A file is read / memory written /<br>
>> etc.<br>
>> I do, however, not sure how to incorporate drivers (which handles IO and<br>
>> external devices) into this. Giving them an `IO a` type feels like<br>
>> cheating. I would be much cooler if there was a way<br>
>> to treat them like the `echo` function from earlier.<br>
>><br>
>> What are your thoughts/suggestions? I'll be happy to hear them.<br>
>><br>
>> Yotam<br>
>> _______________________________________________<br>
>> Haskell-Cafe mailing list<br>
>> To (un)subscribe, modify options or view archives go to:<br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
>> Only members subscribed via the mailman list are allowed to post.<br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> To (un)subscribe, modify options or view archives go to:<br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> Only members subscribed via the mailman list are allowed to post.<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Jeff Brown | Jeffrey Benjamin Brown</div><div dir="ltr"><a href="https://msu.edu/~brown202/" style="font-size:12.8px" target="_blank">Website</a>   |   <a href="https://www.facebook.com/mejeff.younotjeff" style="font-size:12.8px" target="_blank">Facebook</a>   |   <a href="https://www.linkedin.com/in/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">LinkedIn</a><span style="font-size:12.8px">(spammy, so I often miss messages here)   </span><span style="font-size:12.8px">|</span><span style="font-size:12.8px">   </span><a href="https://github.com/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">Github</a><span style="font-size:12.8px">   </span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>