Skip to content

Tips for a Haskell version #10

@Qqwy

Description

@Qqwy

After reading this challenge (and the nice Medium post about a C++ implementation), I immediately thought back to the paper APLicative programming with Naperian Functors, which talks about how you can much of the functionality you describe in your challenge in a type-safe way in a language that is expressive enough without creating all kinds of crazy constructs:

  • N-dimensional data structures whose contents are lazily evaluated.
  • Arbitrary types of elements can be stored inside.
  • Operations work on these N-dimensional datastructures without extra work, as long as they make sense for their element type.
  • Broadcasting to combine data structures, and re-use slices rather than duplicating data. (7. 'Symbolic Transformations')
  • Everything is statically typed, so the compiler will bark at you when you try to combine incompatible data structures, as well as being able to perform crazy loop fusions and optimizations. (Probably. It should. But of course, I don't have a benchmark for you yet to make this point 😜 )

It's well-worth the read, written to be understandable even for people who are not well-versed in Haskell, in literate-programming style.
I'm unfortunately short on time, so I don't think I'll be able to develop a specific implementation of the challenge for Haskell, but this might inspire some other people to make it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions