Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

function-composition

Dot Operator in Haskell: need more explanation

January 7, 2023 by Tarik

Put simply, . is function composition, just like in math: f (g x) = (f . g) x In your case, you are creating a new function, sumEuler that could also be defined like this: sumEuler x = sum (map euler (mkList x)) The style in your example is called “point-free” style — the arguments … Read more

Categories haskell Tags function-composition, haskell, syntax Leave a comment

Haskell function composition (.) and function application ($) idioms: correct use

November 30, 2022 by Tarik

I guess I can answer this from authority. Is there a reason for using the books way that is much better than using all ($) symbols? There’s no special reason. Bryan and I both prefer to reduce line noise. . is quieter than $. As a result, the book uses the f . g . … Read more

Categories haskell Tags coding-style, function-composition, haskell Leave a comment

What is the difference between . (dot) and $ (dollar sign)?

September 7, 2022 by Tarik

The $ operator is for avoiding parentheses. Anything appearing after it will take precedence over anything that comes before. For example, let’s say you’ve got a line that reads: putStrLn (show (1 + 1)) If you want to get rid of those parentheses, any of the following lines would also do the same thing: putStrLn … Read more

Categories haskell Tags function-composition, haskell, syntax Leave a comment
Newer posts
← Previous Page1 Page2

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa