22 research outputs found

    Polymonad programming in Haskell

    Get PDF
    Polymonads were recently introduced by Hicks et al. as a unified approach to programming with different notions of monads. Their work was mainly focussed on foundational aspects of the approach. In this article, we show how to incorporate the notion of polymonads into Haskell, which is the first time this has been done in a full-scale language. In particular, we show how polymonads can be represented in Haskell, give a justification of the representation through proofs in Agda, and provide a plugin for the Glasgow Haskell Compiler (GHC) that enables their use in practice. Finally, we demonstrate the utility of our system by means of examples concerned with session types and the parameterized effect monad. This work provides a common representation of a number of existing approaches to generalized monads in Haskell

    Polymonad programming in Haskell

    Get PDF
    Polymonads were recently introduced by Hicks et al. as a unified approach to programming with different notions of monads. Their work was mainly focussed on foundational aspects of the approach. In this article, we show how to incorporate the notion of polymonads into Haskell, which is the first time this has been done in a full-scale language. In particular, we show how polymonads can be represented in Haskell, give a justification of the representation through proofs in Agda, and provide a plugin for the Glasgow Haskell Compiler (GHC) that enables their use in practice. Finally, we demonstrate the utility of our system by means of examples concerned with session types and the parameterized effect monad. This work provides a common representation of a number of existing approaches to generalized monads in Haskell

    Electrostatic Levitation for Studies of Materials for Additive and In-Space Manufacturing

    Get PDF
    The electrostatic levitation (ESL) laboratory at NASA's Marshall Space Flight Center (MSFC) is a unique facility for investigators studying high-temperature materials. Electrostatic levitation minimizes gravitational effects and allows materials to be studied without contact with a container or instrumentation

    The constrained-monad problem

    Get PDF
    In Haskell, there are many data types that would form monads were it not for the presence of type-class constraints on the operations onthat data type. This is a frustrating problem in practice, because there is a considerable amount of support and infrastructure for monads that these data types cannot use. Using several examples,we show that a monadic computation can be restructured into a normal form such that the standard monad class can be used. The technique is not specific to monads, and we show how it can also be applied to other structures, such as applicative functors. One significant use case for this technique is domain-specific languages,where it is often desirable to compile a deep embedding of a computation to some other language, which requires restricting the types that can appear in that computation

    Unified notions of generalised monads and applicative functors

    Get PDF
    Monads and applicative functors are staple design patterns to handle effects in pure functional programming, especially in Haskell with its built-in syntactic support. Over the last decade, however, practical needs and theoretical research have given rise to generalisations of monads and applicative functors. Examples are graded, indexed and constrained monads. The problem with these generalisations is that no unified representation of standard and generalised monads or applicatives exists in theory or practice. As a result, in Haskell, each generalisation has its own representation and library of functions. Hence, interoperability among the different notions is hampered and code is duplicated. To solve the above issues, I first survey the three most wide-spread generalisations of monads and applicatives: their graded, indexed and constrained variations. I then examine two approaches to give them a unified representation in Haskell: polymonads and supermonads. Both approaches are embodied in plugins for the Haskell compiler GHC that address most of the identified concerns. Finally, I examine category theory and propose unifying categorical models that encompass the three discussed generalisations together with the standard notions of monad and applicative

    Unified notions of generalised monads and applicative functors

    No full text
    Monads and applicative functors are staple design patterns to handle effects in pure functional programming, especially in Haskell with its built-in syntactic support. Over the last decade, however, practical needs and theoretical research have given rise to generalisations of monads and applicative functors. Examples are graded, indexed and constrained monads. The problem with these generalisations is that no unified representation of standard and generalised monads or applicatives exists in theory or practice. As a result, in Haskell, each generalisation has its own representation and library of functions. Hence, interoperability among the different notions is hampered and code is duplicated. To solve the above issues, I first survey the three most wide-spread generalisations of monads and applicatives: their graded, indexed and constrained variations. I then examine two approaches to give them a unified representation in Haskell: polymonads and supermonads. Both approaches are embodied in plugins for the Haskell compiler GHC that address most of the identified concerns. Finally, I examine category theory and propose unifying categorical models that encompass the three discussed generalisations together with the standard notions of monad and applicative

    Supermonads: one notion to bind them all

    No full text
    Several popular generalizations of monads have been implemented in Haskell. Unfortunately, because the shape of the associated type constructors do not match the standard Haskell monad interface, each such implementation provides its own type class and versions of associated library functions. Furthermore, simultaneous use of different monadic notions can be cumbersome as it in general is necessary to be explicit about which notion is used where. In this paper we introduce supermonads: an encoding of monadic notions that captures several different generalizations along with a version of the standard library of monadic functions that work uniformly with all of them. As standard Haskell type inference does not work for supermonads due to their generality, our supermonad implementation is accompanied with a language extension, in the form of a plugin for the Glasgow Haskell Compiler (GHC), that allows type inference for supermonads, obviating the need for manual annotations

    Sunroof: A Monadic DSL for Generating JavaScript

    Full text link

    Injured Children Due to Urban Violence: Psychological and Familial Impact

    No full text
    Urban Violence is becoming increasingly prevalent and children are often unwitting victims of its effects. Little research has been conducted that has specifically examined the psychological effects of this type of violence on the victim(s), and how such violence and concomitant injury impact the family and parental structures. The purpose of this present study is to examine how post-traumatic stress can develop differently after a child experiences a traumatic event involving either an urban violence related situation (e.g. drive-by-shooting, stabbing, gang-related, etc.) or a non-violent/accidental situation. In addition, we will examine how the individuals\u27 community of living and home environment, levels of support, and social and economic circumstances can affect the development of traumatic stress in conjunction with either a violence related or non-violence related injury. Individuals who have experienced either of these types of injuries between the ages of 6 and 16 will be recruited as inpatients at a local hospital within 48 hours of their initial injury and admittance. Children with severe brain injury will be excluded from the study. Measures of psychosocial and familial functioning will be administered at intake, as well as during 6 and 12 month follow-up visits taking place over the phone. Following the data collection phase, results will be initially analyzed using a two factor mixed design analysis of co-variance (ANCOVA) in multiple regression to remove the effects of identified covariates (e.g., Socio-economic status, race, gender) within the research design as well as to adjust each group mean on the dependent variable. Subsequently, repeated Multivariate analyses of covariance (MANCOVA) will be conducted to determine group differences (urban violence vs. accidental injury) with respect to outcome variables (behavioral and emotional problems, traumatic stress, family functioning and coping levels.
    corecore