esqueleto 返回的previousLogItem
数据类型包含Data.Text.Internal.Lazy.Text
import Data.Text.Lazy (pack)
previousLogItem <- select $ from $ \l -> do
orderBy [desc (l ^. LogItemId)]
limit 1
return (l ^. LogItemTitle)
后来我尝试使用以下方法进行previousLogItem
比较exampleCharList
:
[Value (pack currentWindowTitle)] == previousLogItem
但这不起作用,因为类型仍然不同:
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)’