c# - Conditional Operator in F# (A?B:C) -


this question has answer here:

in c#, have conditional operator:

[condition] ? [value if true] : [value if false] 

but can't seem find in f#. exist?

as found here answer is

c# has ternary operator "?:" conditional expressions:

condition ? trueval : falseval  

f# has same operator, name if-then-else:

if condition trueval else falseval 

(note "if" used less in f# in c#; in f#, many conditionalexpressions done via pattern-matching rather if-then-else.)

the website linked offers bunch of c# vs f# examples.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -