Although a Haskell newbie, I have used records before. They are easy to use. But now, when I wish to pull some data from a record, I am getting a 'found hole' error. The offending code is:
let theSchemaId = _schemaId schema
where the record is defined thus:
data Schema = Schema
{ _schemaId :: !SchemaId
, [ other fields ... ]
}
This seems perfectly straight forward to me, similar to records I have used before. However, when running the line of code above, I get the following error below. All imports are in place. Any ideas as to its cause?
the error:
src/master/haskell-service/src/Handler/Strategy/Components/View.hs:695:34: error:
src/master/haskell-service/src/Handler/Strategy/Components/View.hs:695:34: error:
• Found hole: _schemaId :: Schema -> SchemaId
Or perhaps ‘_schemaId’ is mis-spelled, or not in scope
• In the expression: _schemaId
In the expression: _schemaId schema
In a pattern binding: theSchemaId :: SchemaId = _schemaId schema
• Relevant bindings include
theSchemaId :: SchemaId