217 research outputs found

    No value restriction is needed for algebraic effects and handlers

    Full text link
    We present a straightforward, sound Hindley-Milner polymorphic type system for algebraic effects and handlers in a call-by-value calculus, which allows type variable generalisation of arbitrary computations, not just values. This result is surprising. On the one hand, the soundness of unrestricted call-by-value Hindley-Milner polymorphism is known to fail in the presence of computational effects such as reference cells and continuations. On the other hand, many programming examples can be recast to use effect handlers instead of these effects. Analysing the expressive power of effect handlers with respect to state effects, we claim handlers cannot express reference cells, and show they can simulate dynamically scoped state

    Functional Programming for Modular Bayesian Inference

    Get PDF
    We present an architectural design of a library for Bayesian modelling and inference in modern functional programming languages. The novel aspect of our approach are modular implementations of existing state-of- the-art inference algorithms. Our design relies on three inherently functional features: higher-order functions, inductive data-types, and support for either type-classes or an expressive module system. We provide a perfor- mant Haskell implementation of this architecture, demonstrating that high-level and modular probabilistic programming can be added as a library in sufficiently expressive languages. We review the core abstractions in this architecture: inference representations, inference transformations, and inference representation transformers. We then implement concrete instances of these abstractions, counterparts to particle filters and Metropolis-Hastings samplers, which form the basic building blocks of our library. By composing these building blocks we obtain state-of-the-art inference algorithms: Resample-Move Sequential Monte Carlo, Particle Marginal Metropolis-Hastings, and Sequential Monte Carlo Squared. We evaluate our implementation against existing probabilistic programming systems and find it is already com- petitively performant, although we conjecture that existing functional programming optimisation techniques could reduce the overhead associated with the abstractions we use. We show that our modular design enables deterministic testing of inherently stochastic Monte Carlo algorithms. Finally, we demonstrate using OCaml that an expressive module system can also implement our design

    Peculiar Labial Duct in the Camel Philtrum: Structure and Feasible Functions

    Get PDF
    The philtrum is well known as a median groove within the upper lip of mammalian species. However, a peculiar serpentine duct was identified within the mucosal surface of the camel philtrum. To the best of the author’s knowledge, the available literature did not mention any information regarding the presence of a complete duct in such location. For these, this study was aimed to reveal the gross and microscopic structure as well as to discuss the possible functions of this labial duct in dromedary. Twenty snouts from 20 camel heads were used. The labial duct had unique morphological and microscopic structure. It was a median highly tortuous duct with proximal and distal segments connected to each other through a capillary portion. The latter revealed only at the microscopic level. The duct had two entrances, the proximal and distal papillae. Importantly, the microscopic studies revealed that it also had an olfactory portion. In conclusion, the labial duct in camels is a peculiar anatomical structure, which may function as an organ of alarm

    A developed IoT technique and P&O-MPPT to enhance the output power of solar cell systems

    Get PDF
    Abstract- Given the urgent need for continuous development in solar cell systems to increase their efficiency, in this study, a developed IoT technique was built to monitor the solar irradiance fluctuation around the solar cell systems, and a Perturbation and observation algorithm (P&O) was developed to increase the output power from the PV systems. In order to save energy, the IoT technique has been supported with a light-dependent resistor to operate and shut down with sunlight. The whole IoT technique was fed from the PV system to save energy and avoid a power outage. The measured solar irradiance profile was displayed online on the ubidots. Then, the measured solar power irradiance through IoT was introduced to the MATLAB simulation program to study the performance of the proposed P&O maximum power point tracking (P&O-MPPT) algorithm. The P&O-MPPT algorithm was used to control the voltage and current by continuous adjustments in the duty cycle to improve the output power of the studied solar system. The obtained results showed the efficiency of the monitoring system based on IoT in recording changes in solar radiation and the improvement in the output power as a result of the developed P&O-MPPT system

    An Algebraic Theory for Shared-State Concurrency

    Get PDF
    • …
    corecore