Oriel Jutty :hhHHHAAAH:

Indoor European. I know #regex. I write #code (in #C or #Haskell or #Perl or #JavaScript or #bash). 100% OPSEC.

  • 0 Posts
  • 13 Comments
Joined 3 years ago
cake
Cake day: November 6th, 2022

help-circle



  • Both of those declarations look weird to me. In Haskell it would be:

    a :: Stringbob :: (String, Int, Double) -> [String]bob (a, b, c) = ...
    

    … except that makes bob a function taking a tuple and it’s much more idiomatic to curry it instead:

    bob :: String -> Int -> Double -> [String]bob a b c = ...-- syntactic sugar for:-- bob = \a -> \b -> \c -> ...
    

    The [T] syntax also has a prefix form [] T, so [String] could also be written [] String.

    OCaml makes the opposite choice. In OCaml, a list of strings would be written string list, and a set of lists of strings would be string list set, a list of lists of integers int list list, etc.