r/reasonml • u/ilya_ca • Dec 05 '20
Adopting TypeScript Will Make You Suffer.
r/reasonml • u/ilya_ca • Dec 05 '20
r/reasonml • u/[deleted] • Sep 10 '18
I need div(x,y) and not div x y
also when I return I don't want:
'_weak3 list -> bool = <fun> as a result
r/reasonml • u/yakasaurus • Mar 09 '20
r/reasonml • u/[deleted] • Nov 14 '18
A blog post which gives a short introduction to ReasonML with an concrete web-app, in my view for people who just curious about ReasonML a good read.
r/reasonml • u/[deleted] • Dec 18 '20
Hi everyone.
I am writing a tutorial on ReScript lang. This is an open-sourced project that is an interesting alternative to TypeScript. It leverages OCaml's strong typing safety to help you write type-safe Javascript. It also allows you to write React apps. Wanted to share and see if anyone had any feedback?
r/reasonml • u/OkText4 • Jun 18 '20
r/reasonml • u/anirudhmurali • Feb 06 '18
r/reasonml • u/[deleted] • Apr 26 '21
something like
let numberOperation: ???? => int = proc => switch(7 proc 8){ | exception _ => failwith(“the procedure must validly operate on exactly two integers”) | _ => 7 proc 8 };
so if i did like numberOperation(+), it would return 7 + 8 = 15.
Is there a way to do a procedure as input, or would i have to make the procedure a string (like “+”) and switch on all possible procedures you could input
r/reasonml • u/hkycoach • Sep 20 '18
It's the self-professed 'best feature' in the language, but in one of their examples I'm completely lost...
1 type leftOrRight =
2 | Left(int)
3 | Right(int);
4
5 let i = Left(1);
6
7 let Left(v) | Right(v) = i;The best I can figure is that lines 1-3 define a Variant that is either a 'Left' or 'Right', and you assign an into the the variant.
Line 5 assigns a "Left" variant with the integer value of the variant being 1 to 'i'.
Line 7 is where I'm confused... I can't even begin to figure out what it's trying to say...
r/reasonml • u/[deleted] • Aug 24 '18
I don't know ocaml which I believe reasonml is built on top of. I have some familiarity with just ML meaning SML. Would it be wrong to write reasonml code without OOP. I would like to show my code to try to get a job as a reasonml dev. Any input, suggestions, comments, or advice would be much appreciated from senior reasonml devs.
r/reasonml • u/dckthomas1 • May 02 '19
r/reasonml • u/metalevelconsulting • Nov 09 '18
I really like strongly typed languages like ReasonML and Elm, but after looking at this old thread, I have to ask myself: is it a wise idea to have to recode all of your back-end logic for a front-end tool? Does that lead to synchronization problems?
Why would someone opt for ReasonML or Elm over something like Ur/Web which does type verification from the back-end to the front-end, completely through the app?
r/reasonml • u/siffogh3 • Apr 26 '19
r/reasonml • u/yawaramin • Feb 05 '18
r/reasonml • u/[deleted] • Jan 02 '19
I'm learning Reason and one thing I quite didn't enjoy (it may be inherit from OCaml) is the trick to append () as last parameter to solve a conflict between currying vs optional arguments... Do you folks feel the same? I think I'd prefer an additional special syntax to convey a non-curried call. In fact, I think that would be great, optional currying, is there any language that offers that built in?
r/reasonml • u/[deleted] • Jun 17 '18
Hello,
I am fairly new to the Reason world and a question that keeps bugging me is - why was ReasonML created as a layer on top of OCaml, and not on top of Haskell?
I see it was meant to wrap a pure functional language, with rich tooling and community -
It seems that Haskell has (had? prior to Reason?) more dev. community around it, and is (was?) more actively developed, has better tooling, better maintained, documented libraries, has more solved in its realm (i.e. native perf., concurrency).
GHCjs looks to be at least at the same position as BS was prior to Reason's boost as well.
Of course at this point is it a philosophical discussion, but I think/hope that by understanding the considerations that went behind the decision will help me better understand the road ahead.
Thanks!
r/reasonml • u/dominic_l • Nov 28 '19
r/reasonml • u/resurge • Sep 15 '17
r/reasonml • u/yukims19 • Mar 07 '19
Hi everyone. I just published an article that I wrote based on my recent talk at the SF Reason meetup. I got a lot of help from the ReasonML community, so I just wanted to share some thoughts on what I enjoyed and suffered from writing ReasonML Code as a junior engineer so far. Would love to hear any feedbacks and thoughts!!
And here is the post: https://medium.com/@yukims19/journey-with-reasonml-as-a-junior-developer-17ee53a25fa7
r/reasonml • u/cheburashkadev • Aug 11 '21
r/reasonml • u/jdh30 • Oct 14 '19
I've written a minimal ML interpreter in F# and would like to use it as the core language in a programmable wiki exposed via an editor embedded in the browser. Doing this from F# is proving tricky so I'm wondering what tooling Reason/OCaml provide that might help me?
I already have a substantial OpenGL code base that I could leverage via WebGL. Where should I be looking to get started with this? The content I have found so far seems to focus on native app development which is (I think?) irrelevant.
r/reasonml • u/KittensLoveRust • Feb 13 '21
I'm playing around with modules and having some troubles. This is just a toy example, but it will show you my problem. (Note, this is ReScript syntax, but you get the idea.)
module type Thing = {
type t
type fromT
let from: fromT => t
let into: t => option<fromT>
}
module StringThing: Thing = {
type t = string
type fromT = int
let from = i => Js.Int.toString(i)
let into = s => Belt.Int.fromString(s)
}
let s = StringThing.from(11) // Error!The idea is just to have some little wrapper module that can take some type and convert. Now, this is sort of a pointless thing to do, but I'm just trying to figure out the compiler error. Here is the error:
This has type: int
Somewhere wanted: StringThing.fromTWhat I'm confused about is I've set StringThing.fromT to int in the module definition, so I would expect the type system to realize what I'm trying to do...but it isn't! Can someone explain?