Skip to content

What's the reason for using instantiated types? #3

Answered by jakobnissen
CiaranOMara asked this question in Q&A
Discussion options

You must be logged in to vote

In some sense it's arbitrary - with singleton structs, the type and the instance are the same, functionally. However, the Julia style recommendation recommends using instances, so that's what we do, too.

Edit: For the same reason, the following is in the docstring of Alphabet:

* Except for `eltype` which must follow Base conventions, all functions operating
  on `Alphabet` should operate on instances of the alphabet, not the type.

Replies: 0 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@TransGirlCodes
Comment options

@CiaranOMara
Comment options

Answer selected by CiaranOMara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants