# FSharp.Data XmlProvider - Can a Type be Stored for Later Reuse?

**URL:** <https://forums.fsharp.org/t/fsharp-data-xmlprovider-can-a-type-be-stored-for-later-reuse/478>\
**Category:** General\
**Tags:** beginners\
**Created:** [September 20, 2018, 4:16pm UTC](https://forums.fsharp.org/t/fsharp-data-xmlprovider-can-a-type-be-stored-for-later-reuse/478 "2018-09-20T16:16:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jort](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jort](https://forums.fsharp.org/u/jort)\
**Post date:** [September 20, 2018, 4:16pm UTC](https://forums.fsharp.org/t/fsharp-data-xmlprovider-can-a-type-be-stored-for-later-reuse/478/1 "2018-09-20T16:16:01Z")

</div>

Hello,  
I apologize if this is a dumb newbie question. I’m finding the XML Provider very powerful. I can generate a type from a large (static) XML file and then do much with that. My question is - do I have to regenerate that type from the sample file each time I want to run my code, or can I do that once and somehow store the type definition in a file?  
Perhaps the overhead of creating it from scratch each time won’t be that bad, but it seems wasteful.

Thank you!  
-Jack

---

<div class="post-metadata">

**Author:** ![HoraceGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/horacegonzalez/32/352_2.png) [@HoraceGonzalez](https://forums.fsharp.org/u/HoraceGonzalez)\
**Post date:** [September 20, 2018, 4:19pm UTC](https://forums.fsharp.org/t/fsharp-data-xmlprovider-can-a-type-be-stored-for-later-reuse/478/2 "2018-09-20T16:19:33Z")

</div>

I believe the type information is checked/generated at compile time. It’s not necessary to regenerate it each time the program is run.

---

<div class="post-metadata">

**Author:** ![jort](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jort](https://forums.fsharp.org/u/jort)\
**Post date:** [September 20, 2018, 4:40pm UTC](https://forums.fsharp.org/t/fsharp-data-xmlprovider-can-a-type-be-stored-for-later-reuse/478/3 "2018-09-20T16:40:50Z")

</div>

…so used to running scripts, wasn’t even thinking that eventually I can run this compiled.

Thank you Horace!

---

<div class="post-metadata">

**Author:** ![btran](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/btran/32/250_2.png) [@btran](https://forums.fsharp.org/u/btran)\
**Post date:** [September 22, 2018, 6:42pm UTC](https://forums.fsharp.org/t/fsharp-data-xmlprovider-can-a-type-be-stored-for-later-reuse/478/4 "2018-09-22T18:42:38Z")

</div>

There is no “eventually”. F# is a compiled language. This is true even when you run it from a script. Unlike a truly scripted language, the source must pass the compiler without error before it can execute. This includes type providers, which is a means the compiler uses to generate types based on other information than F# source.
