These are chat archives for Microsoft/visualfsharp

15th
Aug 2016
Jared Hester
@cloudRoutine
Aug 15 2016 08:22
@forki does this seem reasonable to you? Microsoft/visualfsharp#1438
Steffen Forkmann
@forki
Aug 15 2016 08:23
I think I would start with that discussed sample and send a PR for further discussion
Jared Hester
@cloudRoutine
Aug 15 2016 08:25
is there a better type safe way to construct the error msg strings?
Steffen Forkmann
@forki
Aug 15 2016 08:26
who cares!? just create a nice message in the function itself
we don't need to abstract all that stuff
Jared Hester
@cloudRoutine
Aug 15 2016 08:26
:D
the subsitution does make it a bit easier in some cases, but most of them don't need it
Steffen Forkmann
@forki
Aug 15 2016 08:27
I mean "reuse" is one of the reasons why error messages are bad.
Jared Hester
@cloudRoutine
Aug 15 2016 08:28
i did want to avoid "array1.Length = " + string array1.Length + ", array2.Length = " string array2.Length" etc
that hodgepodgy stuff
Steffen Forkmann
@forki
Aug 15 2016 08:29
Then use String:Format ;-)
Jared Hester
@cloudRoutine
Aug 15 2016 08:30
:+1: just wanted to be sure it was the best option
Steffen Forkmann
@forki
Aug 15 2016 08:32
not sure if best, but it's good enough. we're not haskell
Jared Hester
@cloudRoutine
Aug 15 2016 08:32
they do stuff in a dumb way all the time :laughing:
Steffen Forkmann
@forki
Aug 15 2016 08:35
No, but they will do everything to abstract this to the max
Jared Hester
@cloudRoutine
Aug 15 2016 08:36
string = char list? tsk tsk tsk
template haskell? what a mess
record resolution? such a pain
Steffen Forkmann
@forki
Aug 15 2016 08:39
Anyways, try to fix one function. And then we will see how to proceed
Jared Hester
@cloudRoutine
Aug 15 2016 08:39
i'll work on the string interpolation rfc and give kevin a chance to tell me not to do it ;P
Fabio Luz
@fabioluz
Aug 15 2016 15:06
Hey guys, I came from a C# world. F# and functional-programming are getting my attention, but I have some doubts about their purposes. Can I use F# for building asp.net web api projects? I mean, does it make sense? Or should I use F# only for internal libraries? I'm still reading and studying the functional concepts, sorry for the ignorance
varon
@varon
Aug 15 2016 15:28
Basically anything C# can do, F# can do. A lot of us are using it for web related tasks. It's well suited.
Steffen Forkmann
@forki
Aug 15 2016 15:29
the concrete question on asp.net is not that easy to answer ;-)
they didn't really make that easy to use from F#. but a small C# layer with your controllers calling into F# domain model will probably work very well
but there are very very good alternatives like https://suave.io/
varon
@varon
Aug 15 2016 15:30
If you're starting a new project, Suave is a great idea.
Fabio Luz
@fabioluz
Aug 15 2016 15:30
hmmm so, in your opinion, it would be better to use c# in the application layer, right?
Steffen Forkmann
@forki
Aug 15 2016 15:31
nope
I just said it's not easy to use from asp.net ;-)
Fabio Luz
@fabioluz
Aug 15 2016 15:32
I see
Steffen Forkmann
@forki
Aug 15 2016 15:32
(which would give me a different conclusion from what you just said ;-) )
Fabio Luz
@fabioluz
Aug 15 2016 15:33
thank you
Steffen Forkmann
@forki
Aug 15 2016 15:33
joking aside C# / F# interop works great
a thin asp.net layer in C# and everything else in F# ist not a bad idea
Fabio Luz
@fabioluz
Aug 15 2016 15:34
yeah, this looks easier
varon
@varon
Aug 15 2016 15:34
Definitely check out Suave before you make up your mind, though.
Fabio Luz
@fabioluz
Aug 15 2016 15:35
@varon I'll definitely check! Thanks!
Justin
@WreckedAvent
Aug 15 2016 16:19
the neat thing about f# is you can have very functional code and then provide a more OOP interface to C# code
(which happens to utilize the F# stuff)
best of both worlds