Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[Haskell] We write a pure program in Haskell

Name: Anonymous 2019-05-08 10:14

Any post is ignored if:
* code isn't fully conforming Haskell 2010
* contains a definition of main outside of >>999
* FFI is used or modules imported that are not provided with a standard Haskell Platform install

Name: Anonymous 2019-05-14 6:41

>>13
The best case use for Haskell is the use of functions to perform functions. We can take the function f :: Int -> Int as the argument of its argument f :
f xs :: int = f xs
Notice the type signature for the function f : the type of the function is int . That type signature can be modified and written in a variety of ways. For example, the above example could be done using type polymorphism in the GHC compiler. Let's take a look.
Let's suppose we have written f :: Int -> int . This can be read as follows: This function f must be used in any function f that takes an argument of type int . However the Haskell type signature can be modified to be either an Int or a Maybe Int .
So in the example above, we have given the result type from Haskell like this: data Just a = Just (a) data Maybe a = Nothing A Haskell might look like this:
In fact Haskell allows you to do things such that the type signature of a function f will change in a manner similar to that for reading the type in a language.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List