HackerPapers

arXiv:1403.0749cs.PL

Free Applicative Functors

Paolo Capriotti, Ambrus Kaposi

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

Applicative functors are a generalisation of monads. Both allow the expression of effectful computations into an otherwise pure language, like Haskell. Applicative functors are to be preferred to monads when the structure of a computation is fixed a priori. That makes it possible to perform certain kinds of static analysis on applicative values. We define a notion of free applicative functor, prove that it satisfies the appropriate laws, and that the construction is left adjoint to a suitable forgetful functor. We show how free applicative functors can be used to implement embedded DSLs which can be statically analysed.

arXiv comments
In Proceedings MSFP 2014, arXiv:1406.1534
Journal reference
EPTCS 153, 2014, pp. 2-30
DOI
doi:10.4204/EPTCS.153.2
Subjects
cs.PLProgramming Languages math.CTCategory Theory

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Sep 2016 to Sep 2016.

Comments linking this paper, per year.

Discussed in comments1 thread

    • Yeah, the free monad structures involve lots of lambdas. It's not so much that information is "lost", more that you cannot see beyond the next lambda abstraction. From a DSL perspective, it's like you can only inspect the program so far as to know the next statement in the "do"…

      mbrockView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.