Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #140 in line with design suggested at #140 (comment)
The idea is that users were never meant to use
IsString.fromString
directly, this method should be invoked only by{-# LANGUAGE OverloadedStrings #-}
magic. This PR effectively enforces this limitation.IsString.fromString = packCharsSafe
. This is a partial function,throwing errors on characters out of Latin1 range, but partiality is not a big
deal for interactive sessions.
IsString.fromString = packChars = unsafePackLiteral
,no runtime overhead and Core remains exactly the same as before.
'\0'
)IsString.fromString = packCharsSafe
.This incurs runtime overhead, but such thunk is evaluated only once in its life.
IsString.fromString = error
.This is to make runtime behaviour more robust (if it crashes, it crashes for
any input) and avoids a danger of routines, which were tested only for ASCII
inputs but suddenly receive Unicode and silently lose data.