pitch. I don’t want to attack your community, but I do want to steal some brains for mine I love the work you do as a community and I wish we could have the same in ours.
and usually forces you to be more explicit. Ex: - 3 + “hola” is not accepted ❌ - if “hola” … ❌ The type system is less strict and usually performs implicit conversions for you. Ex: - 3 + “hola” is accepted ✅ - if “hola” … is accepted ✅ The type analysis of expressions is performed at compile time. The type analysis of expressions is performed at run time.
because a type system can prove the absence of some bad program behaviours, but they cannot prove their presence! Program testing can be used to prove the presence of bugs, but never show their absence!
into while loops Performance penalty of using functions FP langs eliminate functions by inlining-them Performance penalty of boxed data types FP langs eliminate those boxes FP problems when used outside functional languages
Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. Steele & Crockford’s Corollary: Any sufficiently interesting JavaScript library contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Haskell.
new value null and treat it as an ‘a’ you are augmenting the set ‘a’ with a new possibility (null) that has to be checked always. What happens if the list if empty?
the same properties as a head : List a -> a someOp = head [] + 3 Nonsense, null with a number has no well defined meaning! This leads to null propagation. null
a shape that represents several types type Bool = True | False > True : Bool > False : Bool Bool type defined Type can be constructed with either True or False constants (product)
a shape that represents several types type Duple a b = Duple a b > Duple True False : Duple Bool Bool > Duple “hello” ‘h’ : Duple String Char Shape of all the duple types defined I’m the function that knows how to construct a value of type ‘Duple a b’ Need both: a and b (coproduct or sum)
for creating a value of a given data type case boolValue of True -> “created by True” False -> “created by False” case stringValue of “hi” -> “created by “hi”” _ -> “dunno”
very good idea, maximises the advantages of each one (FP & type systems) and gives the developer more grip at controlling a project’s complexity because it makes explicit the side-effects in your application and brings them under control. 109