I need to extract a string version of state from a record. Code below:
type State = State of string
type Data =
{ State : State
Year : int
Income : float }
What I need to do is extract a sequence of the string version of each state, and not State "string". When I try to do something like below, I get an empty sequence. I run the code below after running code which processes and maps data to the above records.
let states (row:Data) = row.State
// <fun:it@145-1> val it : unit = ()
I need a sequence because in the end I will use this to check and make sure the states in one dataset are in a sequence of another.
EDITED:
After doing something like what is below, I still get the empty sequence.
let stateToStr (State s) = s
let statec (row:StateCsv) = (stateToStr row.State)
printfn "%A" statec
// val stateToStr : State -> string
// val statec : row:StateCsv -> string
// val it : unit = ()
Again after maping data to records like so:
let statepa () =
Stat.GetSample().Rows
|> Seq.map(fun row ->
{ State = row.STATE
Year = row.Year })