The previousLogItem
data type returned by esqueleto contains Data.Text.Internal.Lazy.Text
import Data.Text.Lazy (pack)
previousLogItem <- select $ from $ \l -> do
orderBy [desc (l ^. LogItemId)]
limit 1
return (l ^. LogItemTitle)
Later I tried to compare previousLogItem
with exampleCharList
by using:
[Value (pack currentWindowTitle)] == previousLogItem
But that does not work since the types still differ:
Couldn't match type ‘Data.Text.Internal.Lazy.Text’
with ‘Text’
NB: ‘Text’ is defined in ‘Data.Text.Internal’
‘Data.Text.Internal.Lazy.Text’
is defined in ‘Data.Text.Internal.Lazy’
arising from a functional dependency between:
constraint ‘Database.Esqueleto.Internal.Sql.SqlSelect
(SqlExpr (Value Text)) (Value Data.Text.Internal.Lazy.Text)’
arising from a use of ‘select’
instance ‘Database.Esqueleto.Internal.Sql.SqlSelect
(SqlExpr (Value a)) (Value a)’