reason Questions
4
Solved
I’m new to reason-react. I’m trying to put a copyright symbol in a react-reason component. I've tried
<span >(ReasonReact.stringToElement("&copy;"))</span>
but this doesn’t give...
Danley asked 28/2, 2018 at 22:9
5
Solved
For example in Ruby you could do something like:
list = ["foo", "bar", "baz", "qux", "quux", "corge"]
result = list[2..4]
And result would contain ["baz", "qux", "quux"].
How would you do this ...
2
Solved
I'm a big fan of creating data structures that make representing invalid states impossible, so I wanted to ask how I could represent a non empty list in reasonml?
Since it's possible to pattern ma...
1
Solved
Let's say I have a higher-order component, something like the following trivial definition, exported from the JavaScript module ./hoc.js:
export const withStrong =
Component => props =>
&l...
Chorography asked 24/8, 2019 at 20:17
2
A period of intense googling provided me with some examples where people use both types of operators in one code, but generally they look just like two ways of doing one thing, they even have the s...
Huntley asked 2/4, 2019 at 12:16
2
Solved
The way that the "fast pipe" operator is compared to the "pipe last" in many places implies that they are drop-in replacements for each other. Want to send a value in as the last parameter to a fun...
Nysa asked 2/3, 2019 at 10:37
2
Solved
One advantage of Reason ML over JavaScript is that it provides a Map type that uses structural equality rather than reference equality.
However, I cannot find usage examples of this.
For exampl...
Cuneo asked 16/2, 2018 at 16:12
2
Solved
I am very new to ReasonML. I am able to successfully create a stateless component with ReasonReact, but I have not figured out how I might add a custom method to the component (e.g. Next.js' static...
Approach asked 27/11, 2017 at 0:55
6
What are the tradeoffs between ReasonML (https://reasonml.github.io/) and TypeScript (https://www.typescriptlang.org/)?
Beefsteak asked 11/9, 2017 at 1:59
1
Solved
I am trying to write bindings for https://github.com/oblador/react-native-keychain/blob/master/typings/react-native-keychain.d.ts#L76
getGenericPassword returns false if an error, else an object (...
Ordonez asked 12/9, 2018 at 14:5
3
In JavaScript you can join an array of strings, e.g.:
fruits = ["orange", "apple", "banana"];
joined = fruits.join(", ");
console.log(joined)
// "orange, apple, banana"
How do you do this in R...
Beebe asked 20/4, 2018 at 14:32
2
Solved
What's the most idiomatic way of listening/handling global DOM events in ReasonML.
I'm building a ReasonReact version of the 2048 game where I need to listen for keyboard events.
In a standard JS...
Bevus asked 27/6, 2018 at 22:51
1
I saw this ReasonML vs TypeScript question here at StackOverflow, now I'm wondering how ReasonML and Elm compare to each other.
What are their similarities and differences? Which one should ...
2
Solved
In Reason (and OCaml), there is a non-traditional way of passing arguments using the |> operator. What is the convention for when it should be used? I am currently using it all over the place ju...
Xerxes asked 15/4, 2018 at 16:2
1
Solved
In F# we have Computation Expressions, which can reduce boiler-plate and nesting when working in various computational contexts (async, optionals and so on).
Does ReasonML have an equivalent of ...
Monroe asked 5/4, 2018 at 12:26
1
I'm trying to write a command line tool in reasonML. So I inserted a shebang(#! /usr/bin/env node) at the first line, but the compiler failed to compile it. How do I add a shebang to the compiled o...
Scarcity asked 19/3, 2018 at 3:31
2
I'm using Reason-Apollo to parse a pretty nested GraphQL response from my server. I'm having trouble parsing the hairy tree of options returned from my GraphQL server (I'm using django-graphene).
...
Paxwax asked 21/2, 2018 at 11:18
1
So by reading the reasons why facebook choose OCaml to create Reason, I couldn't stop noting that Scala met all the requirements too.
I'm not biased whatsoever, I know Scala, but I'm not a die hard...
1
Solved
I'm learning Reasonml, and I can't find any function in the standard library to do so, neither of the Bucklescript Js modules. Is there any better option than using raw javascript?
Right now I'm a...
Barrelhouse asked 31/12, 2017 at 19:24
1
Solved
I am trying out Reason-React. I am facing a problem when I try to add a key to one of the components.
I have a TodoApp that takes a list of TodoItem as state. The app works fine when I don't have a...
Registry asked 15/11, 2017 at 6:28
1
Solved
I'm new to OCaml, and I it's often suggested that I use Jane Street's standard-library instead of the one that ships with the compiler.
However, there seem to even be several of those, and I don't...
Percussionist asked 2/10, 2017 at 19:56
2
Solved
I have the following folder structure
--| button
--|--| button.re
main.re
In my bsconfig.json, using the quickstart guide found here. I have in my config the following key/value:
"sources": [
...
Psychoneurosis asked 13/9, 2017 at 1:56
1
Solved
I know that in OCaml, one can create a class doing the following:
class stack_of_ints =
object (self)
val mutable the_list = ( [] : int list ) (* instance variable *)
method push x = (* push m...
1
Solved
I'm quite experienced with ReactJS and now I'm trying to learn ReasonML. But one thing that I've been struggling to understand, is how to import npm packages with React/Reason.
The instructions on...
Sandwich asked 2/9, 2017 at 10:8
1
Solved
https://facebook.github.io/reason/modules.html#modules-basic-modules
I don’t see any import or require in my file; how does module resolution work?
Reason/OCaml doesn’t require you to write any i...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.