Skip to content

Conversation

safareli
Copy link
Contributor

@safareli safareli commented Feb 9, 2018

No description provided.

@@ -0,0 +1,26 @@
module Data.String.NonEmpty
( NonEmptyString(..)
) where
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to either drop this, or export the functions in here ;)

@matthewleon
Copy link
Contributor

I'm curious about your use case. Do you envision adding more convenience functions to this?

@safareli
Copy link
Contributor Author

I wanted to add something like this:

class IsSymbolNonEmpty sym where
 safeStr :: SProxy sym -> NonEmptyString

So one could do safeStr (SProxy :: Sproxy "foo")

But to do this we need CompareSymbol s "" GT from typelevel-prelude which I guess is not desired dependency for this lib? (We might add this typeclass there).

@garyb
Copy link
Member

garyb commented Feb 11, 2018

I'm curious about your use case. Do you envision adding more convenience functions to this?

It feels like I want this more often than the usual String! 😄 And yeah, it needs all the good stuff too.

I'm thinking maybe a newtype would be better though, to keep the underlying string representation simple and just have it smart-constructed. Going to do some stuff on that now.

@safareli
Copy link
Contributor Author

closing in favor of #100

@safareli safareli closed this Feb 12, 2018
@safareli safareli deleted the non-empty branch February 12, 2018 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants