View Item 
        •   Utrecht University Student Theses Repository Home
        • UU Theses Repository
        • Theses
        • View Item
        •   Utrecht University Student Theses Repository Home
        • UU Theses Repository
        • Theses
        • View Item
        JavaScript is disabled for your browser. Some features of this site may not work without it.

        Browse

        All of UU Student Theses RepositoryBy Issue DateAuthorsTitlesSubjectsThis CollectionBy Issue DateAuthorsTitlesSubjects

        Taking a functional datastructure out of context

        Thumbnail
        View/Open
        thesis_taking_a_functional_datastructure_out_of_context.pdf (435.7Kb)
        Publication date
        2025
        Author
        Zutekouw, Raymon
        Metadata
        Show full item record
        Summary
        In purely functional programming languages, operations on pointers are ruled out to guarantee referential transparency. There are language extensions that allow the programmer to write purely functional code, which can be compiled to efficient pointer operations internally. Constructor contexts in Koka are such a language extension, which has introduced a limited API that allows creating values of types which may be extended in O(1) time at the end of the structure by making use of an extra internal pointer. Such constructs remediate the inadequacy of purely functional programming to express code that is cheap and effective within imperative programming. Currently Koka only allows creating and filling these so called constructor contexts, as the implementation is quite new to the language. But one can imagine that this kind of structure can also be pattern matched on, so that you have access to the constructor and arguments like you would with regular pattern matching. What does the language design of that feature look like? And how does it allow defining highly efficient functional datastructures? This research specifies this new feature, and contributes the following: • Demonstrate how to implement queues with O(1) operations with them; • Define pattern matching on constructor contexts as a specification; • Prototype the implementation in a recent Koka compiler version.
        URI
        https://studenttheses.uu.nl/handle/20.500.12932/49305
        Collections
        • Theses
        Utrecht university logo