Skip to content

mmirman/lambda-placeholders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lambda-placeholders

lambda-placeholders is a Haskell library to emulate the placeholders feature of Scala.

Background

  • Placeholders in Scala act similar to those used in category theory.
  • Rather than create a lambda or name a function, an underscore is used in place of a parameter and the function is abstracted over that location.
  • This placeholders library doesn't use underscores, rather it leverages similar capabilities found in TupleSections.
  • A description of Scala placeholders can be found here.

Example

{-# LANGUAGE
 TupleSections 
 #-}
module Main where 
import Language.LambdaPlaceholders

foo (a,b,c) = a + b + c

curried_foo = foo.$.(2, , )

main = do
    putStrLn $ show $ curried_foo 4 5

About

A Haskell library to emulate Scala's placeholder syntax feature.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published