Open cobordism opened 3 weeks ago
Indeed an IO.map2 would be nice. You can create it yourself with andThen:
ioMap2 combineAB ioA ioB =
ioA |> IO.andThen (\a -> IO.andThen (\b -> combineAB a b))
-- in
ioMap2
(\a b -> yourFunction a b)
(File.open "a.txt" |> IO.exitOnError identity)
(File.open "b.txt" |> IO.exitOnError identity)
Thank you. I also just succeeded ... because I just discovered the new-api branch of this repo. (I wish I had found that sooner. )
The instructions in the readme:
npm install -g @albertdahlin/elm-posix
elm install albertdahlin/elm-posix
gives me the older version.
What is the correct way to install the new elm-posix branch?
Pretty sure the author didn't publish it yet.
So you can either try to vendor it, stick with the current API or switch to an alternative like elm-pages-scripts (not sure how) or state-interface
etc.
pardon my ignorance, but what is 'vendor' as a verb?
haha I'm not a native speaker but as I understood it it basically means copy it to your project directly and build/link/... it there with your project
Hello, Is there any way I can use pattern matching to get a
String
from anIO String
? I've tried, but the deeper I dig the more confused I get. Relatedly, is there a way to have amap2
for IO? and a functionIO ( IO a)) -> IO a
?I apologise if these are easy questions. I am new at elm and got confused. The context is that I have a function
String -> String -> String
and I want to read the first two arguments from a text file.Or is there maybe even an "evil" way to just read in a String instead of IO String from a text file ?