Skip to main content
100%

Example of point-free style

✓ Published0🌍 Public
FFranklin Chen
Last edited Oct 6, 2014
Created on Oct 6, 2014

This example demonstrates how to compose functions in a point-free style using Haskell’s `Control.Category` operator `(>>>)`. The code defines a `matches` function that checks whether a given string equals an `Option`’s name prefixed with `"--"`, without explicitly mentioning the arguments. It shows the data flow by chaining `name`, `("--" ++)`, and `(==)` together, making the logic declarative. The example uses a custom `Option` data type and a sample `helpOption` to test the matching with `"--help"`. The source is a gist by FranklinChen, illustrating readable point-free composition in a functional programming context.

AI-generated description

Similar vizzes