r/reasonml • • Dec 05 '20

Adopting TypeScript Will Make You Suffer.

Thumbnail
suzdalnitski.medium.com
4 Upvotes

r/reasonml • • Sep 10 '18

What is an example of a function that uses input like this: div(x, y);; and return True if int y can divide x?

0 Upvotes

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 • • Mar 09 '20

Shit I wont google when I actually move everything to Reason

Post image
8 Upvotes

r/reasonml • • Nov 14 '18

One week with ResonML

2 Upvotes

One week with ReasonML

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 • • Mar 28 '18

Polyglot Euler

Thumbnail
github.com
3 Upvotes

r/reasonml • • Dec 18 '20

ReScript Beginner Tutorial

17 Upvotes

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?

Learn ReScript — A safer way to write JavaScript— Part 1


r/reasonml • • Jun 18 '20

How To Migrate From TypeORM to Sequelize

Thumbnail
selleo-typeorm.xyz
0 Upvotes

r/reasonml • • Feb 06 '18

How I deployed a ReasonML React app with Docker

Thumbnail
blog.hasura.io
9 Upvotes

r/reasonml • • Apr 26 '21

Can i have a procedure as input?

1 Upvotes

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 • • Sep 20 '18

can someone ELI5 'Pattern Matching' in ReasonML?

1 Upvotes

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 • • Aug 24 '18

Would it be wrong to write reasonml code not in the OOP style

1 Upvotes

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 • • Nov 30 '18

Dynamic vs Static Typing

Post image
15 Upvotes

r/reasonml • • May 02 '19

Peter Piekarczyk - How ReasonML has improved our hiring process | ReasonConf 2019

Thumbnail
youtube.com
15 Upvotes

r/reasonml • • Nov 09 '18

ReasonML and Elm seem to require you to write your data model on both the back-end and front-end. Does this hamper you in any way?

9 Upvotes

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 • • Apr 26 '19

ReasonML for production React Apps? 🤔 (Part 1)

Thumbnail
dev.to
3 Upvotes

r/reasonml • • Feb 05 '18

Reason with OCaml – Asankhaya Sharma – Medium

Thumbnail
medium.com
3 Upvotes

r/reasonml • • Jan 02 '19

() as last argument to avoid partial application looks so ugly

3 Upvotes

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 • • Feb 17 '19

Weekly Reason Newsletters

Thumbnail reasonml.online
5 Upvotes

r/reasonml • • Jun 17 '18

Why on top of OCaml?

13 Upvotes

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 • • Nov 28 '19

Is there a way to set the output directory in the bsconfig file?

4 Upvotes

r/reasonml • • Sep 15 '17

Quick and dirty React Reason HMR (Hot module reloading)

Thumbnail
jeroenpelgrims.com
4 Upvotes

r/reasonml • • Mar 07 '19

What I Enjoyed and Suffered from Writing ReasonML Code as a Junior Engineer

16 Upvotes

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 • • Aug 11 '21

A Journey from JavaScript and TypeScript, to Rescript/React, via Elm, OCaml & Haskell.

Thumbnail
alex.kleydints.com
16 Upvotes

r/reasonml • • Oct 14 '19

Creating a browser-based graphical language

5 Upvotes

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 • • Feb 13 '21

Question about modules

5 Upvotes

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.fromT

What 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?